When one mail server tries to send mail to another mail server, it first queries the DNS server for the list of mail servers for that domain. Once that list is obtained, the servers are tried in the order of preference listed - if the first mail server listed does not respond, the second one is tried, and so on. If by chance none of the mail servers responds, the mail is returned to the sender. In the typical set of mail server records below, the MX portion of the entry specifies that the record is a mail exchange record, and the numbers 10, 20, and 30 indicate the order of preference.
yourhost.ntshop.net. IN MX 10 mail.ntshop.net.
yourhost.ntshop.net. IN MX 20 mail2.ntshop.net.
yourhost.ntshop.net. IN MX 30 mail3.ntshop.net.
CNAME records, or canonical name records, are also called alias records. CNAME records allow hosts to have more than one name. For example, you may want your Web server, named www, to run your FTP server as well. You could simply create a CNAME record that creates an alias of "www" for "ftp." CNAME records depend on previously defined address records, so you need to establish an address record for "www" before "ftp" would be usable. Sample CNAME records and their associated address records are shown below.
www.ntshop.net IN A 207.91.166.2
ftp.ntshop.net IN CNAME www.ntshop.net.
When you put all these record types together in a file, you have a DNS table:
mail.domain.com IN A 207.91.166.2
mail2.domain.com IN A 207.91.166.198
www.domain.com IN A 207.91.166.4
ftp.domain.com IN CNAME www.domain.com.
host1.domain.com IN MX 10 mail.domain.com.
host1.domain.com IN MX 20 mail2.domain.com.
You can use other types of DNS records; however, we won’t cover them all in this book. DNS can be a complex subject. You should seek out one of the many books devoted to the subject if you want a complete understanding of its intricacies.
No comments:
Post a Comment