Wednesday, 5 February 2014

How-to: Understand Internet Nameserver records


(Nameserver) A name server is a computer server that hosts a network service for providing responses to queries against a directory service. It maps a human-recognizable identifier to a system-internal, often numeric identification or addressing component. (http://en.wikipedia.org/wiki/Nameserver)

Accurate but dull. Nameservers work behind the scenes to translate the web address that you type in to a machine address that will actually serve up the page.

Nameserver records are a rather complicated subject that we'll barely scratch the surface of here.

There are three basic types of records that nameservers contain about domains and hostnames.

These are A, MX and CNAME records.
  • An A record resolves a host name, say, domain.com, www.domain.com, sub.domain.com, to an IP address such as 173.194.34.78 (that's Google, by the way).
  • An MX record is a Mail eXchange record and resolves mail to a mail server.
  • A CNAME record is does a more complex job; what it does is to make one hostname inherit all the attributes of another hostname. For example, an A record for domain.com resolves to 173.194.34.78. If you set a CNAME for example.com to inherit the attributes of domain.com then it will copy domain.com's a record and also resolve to 173.194.34.78. Any changes to domain.com will also change example.com.
CNAME records are often be confusing, misunderstood and have unforeseen consequences, so try to avoid them. Unless you have hundreds of records to manage, it is worth avoiding CNAME records, which quickly become ambiguous and even contradictory, and stick to A and MX records.

How do you set nameserver records?
You need to have administrative control of the domains in question and have control panel access to the nameservers on which they reside. there, you can edit the three DNS records for the given domain name.

For example, it is normal to have your website on one server and have your mail on another. To begin, youyou need to add A records to resolve your domain and it's most popular subdomain to your web server. Assuming your servers' IP is 173.194.34.78 then they should look like:
  • domain.com A 173.194.34.78
  • www.domain.com A 173.194.34.78
This resolves your domain and the www subdomain to your webserver.

Next add your MX record for the mail. MX records must be set to resolve to a hostname and not an IP address. As such you will need (or find out) what the mail exchange hostnames are. So in our example, let's say that they are mx1.amethyst-dev.com and mx2.amethyst-dev.com, you then need to add:
  • domain.com 10 MX mx1.amethyst-dev.com
  • domain.com 20 MX mx2.amethyst-dev.com
The numbers indicate the priority of the records. Your mail client will try to route outgoing email to the lower numbered record first; if it is offline then it will try the next highest one.

That should be it. RC

No comments:

Post a Comment

At least try to be nice, it won't kill you...