Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

At the time of hosting, normally we just change name servers in the domain control panel. It's fine if both mail and web servers are the same. When they're different, we need to change the DNS records.

When I try to point my blog to my domain name, I came to know about the various types of DNS records - A Records, AAA Records, MX Records, CNAME Records, NS Records, TXT Records, SRV Records, SOA Records, etc. I searched on Google, but would like to know more about these deeply.

I found this link on the Internet - http://www.directnic.com/help/faq/?question_id=103 and got some idea about the different DNS records. But I have some more questions.

  • How do the domain name records work?

  • Is there any difference between NS record and other records in the way they work?

  • Where should the NS record point to when using A record, CNAME record and MX record?

share|improve this question

closed as off topic by Nifle, Journeyman Geek, ChrisF, TFM, Synetech Nov 10 '12 at 13:33

Questions on Super User are expected to relate to computer software or computer hardware within the scope defined by the community. Consider editing the question or leaving comments for improvement if you believe the question can be reworded to fit within the scope. Read more about reopening questions here.If this question can be reworded to fit the rules in the help center, please edit the question.

1  
how Dns Works –  eicto Nov 10 '12 at 8:27
    
@eicto Thank you, I want to know some deeply about Name records. –  Kumar Nov 10 '12 at 8:45
    
what you need to know exactly ? there several rfc about domain name records, and complete answer will just duplicate info from them –  eicto Nov 10 '12 at 8:47
    
You are asking for information on a subject matter that several hundred page books cover. You're going to need to be a LOT more specific. –  Everett Nov 10 '12 at 8:51
1  
An example of the scope of information: en.wikipedia.org/wiki/List_of_DNS_record_types –  Everett Nov 10 '12 at 8:53
show 1 more comment

2 Answers 2

Once you remember few things about DNS, DNS is simple. When you see it for the first time, it seems cryptic. It IS simple, but not because it is easy to use for somebody who sees it for the first time, but because names of records are short and therefore easy to remember, and essentially - there are not so many options to remember. Examples are for google.com domain or from my imagination. :)


1. A record - it tells a DNS server what IP address to map a host name to. Examples:

ns1 A 216.239.32.10

ns2 A 216.239.34.10

sun A 1.2.3.10

moon A 1.2.3.11

mail A 1.2.3.46

yourdomain.com. A 1.2.3.4

If A record is not full domain name to form fully qualified name ("fully qualified" means have form of "host.domain.topdomain" - www.yourdomain.com, www.google.de or www.superuser.com), than it means that A record is connected or related to domain one - ns1 and ns2, sun, moon and mail from above example are all tied to yourdomain.com., meaning:

ns1.yourdomain.com and

ns2.yourdomain.com

Do not forget to write dot on end of domain name: yourdomain (dot) com (dot) = yourdomain.com., that is not error, that is intended to be there!


2. NS record - when world knows IP addresses of your nameservers (there are usually 2 or three, but there can be more), you have to give them names. They are usually called with dull ns1 and ns2, but nothing stops you to call them something nicer, like:

yourdomain.com. NS ns1 and

yourdomain.com. NS ns2

OR

yourdomain.com. NS sun and

yourdomain.com. NS moon

You can have dull (and descriptive) names like ns1, ns2, ns3 etc, or you can have names like sun, moon, bee, honey - it's your choice. Just do not forget to have A records for NS records you create!


3. CNAME and MX records - finally, these two are simple.

www CNAME yourdomain.com.

myserver CNAME yourdomain.com.

You want that both www.yourdomain.com and myserver.yourdomain.com point to yourdomain.com, so you make CNAME aliases.

yourdomain.com. MX 10 mail.yourdomain.com.

Mail designation for your domain.


Is it that simple? Yes, its that simple.

share|improve this answer
add comment

Here are some pointers that explain these in detail:
Debian Help - DNS Records Explained with Examples
DNS for rocket scientists - DNS resource records

  • How do the domain name records work?

    They're used by the client while querying for the appropriate server(s), and the DNS server responds with the right results for the type of query. For example, a mail client program (like Thunderbird) connecting to Gmail would ask the DNS server for MX records for imap.gmail.com. A browser connecting to superuser.com would ask for the A record (for the IPv4 address) or the AAAA record (for the IPv6 address).


  • Is there any difference between NS record and other records in the way they work?

    Yes, each record has a specific purpose and the usage would depend on what information needs to be resolved through DNS.


  • Where should the NS record point to when using A record, CNAME record and MX record?

    The NS record is meant to point to the Authoritative Name Servers for a zone. These are the servers that store all the resource records for the zone/domain and can provide an "authoritative answer" for DNS queries pertaining to that zone/domain.

    For example, the authoritative name servers for superuser.com (and its sub-domains) are ns3.serverfault.com and ns4.serverfault.com. When a browser queries the IP address (looking for the "A record") for superuser.com, it would have to reach either of these servers for an authoritative answer (due to the way DNS works, other servers, including your ISP's DNS server, may cache these results and provide them as non-authoritative answers).

    Where the NS record should point to is to DNS servers (your domain registrar's DNS servers or your own DNS server). It does not matter where the A record, MX record or any other record point to.

share|improve this answer
add comment

Not the answer you're looking for? Browse other questions tagged or ask your own question.