www.realprogrammers.com
has an A
record containing an IP address, say, 64.125.127.90. A web browser can
look for an A record, be told an IP address and from that it can attempt
to connect to it.
host
command. Many are familiar with
nslookup
however this program has been deprecated in favor
of host
and dig
, which we'll see shortly.
$ host www.realprogrammers.com www.realprogrammers.com A 64.125.129.70 $Nothing too surprising there.
$ host -t mx yahoo.com yahoo.com MX 5 mx4.mail.yahoo.com yahoo.com MX 1 mx1.mail.yahoo.com yahoo.com MX 1 mx2.mail.yahoo.com $We see that yahoo.com has apparently three mail servers of which two are considered primary since they have the higher (numerically lower) priority. Now, in order to actually deliver the mail, the delivering server still needs to know the IP address of that server, in other words it has to lookup an A record.
However, upon closer inspection of one such A record we discover,
$ host mx1.mail.yahoo.com mx1.mail.yahoo.com A 64.157.4.81 mx1.mail.yahoo.com A 64.157.4.85 mx1.mail.yahoo.com A 64.157.4.89 $
mx1.mail.yahoo.com
has three IP addresses! So yahoo.com has
many more than three possible destinations for its mail. How does it
choose? The name server being asked for the IP addresses returns a
single address for each query, one after the other. Once it has returned
the last of its collection it starts at the beginning again. This is
referred to as round robin DNS, and can be used as a simple way
to distribute access to a number of servers. Round Robin can as equally
be used for webservers as mail servers, or any job where spreading
connections across multiple addresses may be useful.
realprogrammers.com
domain:
$ host -t ns realprogrammers.com realprogrammers.com NS ns1.granitecanyon.com realprogrammers.com NS ns2.granitecanyon.com realprogrammers.com NS ns2.realprogrammers.com realprogrammers.com NS ns3.realprogrammers.com realprogrammers.com NS ns5.realprogrammers.com realprogrammers.com NS ns0.realprogrammers.com $Again, like an MX record, a further A record query is required to find the actual IP address, or indeed addresses. NS records are also returned to querying clients in a round robin fashion.
$ host -t soa paulm.com paulm.com SOA tantrix.realprogrammers.com hostmaster.realprogrammers.com ( 2002021203 ;serial (version) 10800 ;refresh period (3 hours) 3600 ;retry interval (1 hour) 604800 ;expire time (1 week) 86400 ;default ttl (1 day) ) $The
paulm.com
domain we learn lives on
tantrix.realprogrammers.com
, the contact address is
hostmaster@realprogrammers.com, and well, a bunch of other stuff
:-)