DNS aname vs cname

Random717

Expert Member
Joined
May 30, 2006
Messages
2,121
Reaction score
24
I'm hoping someone can shed some light on DNS anames and cnames.
As I understand it:
- any domain can be an aname record, pointing at a single or multiple IP addresses
- top level domain names need to be anames (?)
- multiple anames can point at a single IP address (?)
- cnames can point at any aname or another cname
- cnames require the client to do multiple dns lookups until it hits an aname

Given the above, I assume I can have both server.example.com and www.server.example.com as anames pointing at a single IP address?
Is there any reason not to do this?
It's a small webserver with no email or anything fancy running on it.

Thanks :D
 
A records are ADDRESS records. You can have any number of names with A records pointing to a single IP address.

CNAME records are pointers to another name. As you say, the client will need to make multiple requests until it gets to an A record.

You can either have both www.x.com and x.com as A records, or either of them as an A record, and the other as a CNAME. When you only have two records to update, I'd probably just have 2 A records.
 
For example:

A Record mail.yourserver.com 196.123.23.12
CName smtp.yourserver.com mail.yourserver.com
CName pop3.yourserver.com mail.yourserver.com


When requesting pop3.yourserver.com, it sends it to the mail.yourserver.com which resolves to 196.123.23.12

when you change your mail server, you update the IP, and Bob should be your uncle
 
To break it down in its simplest form.

A Records will always point to a IP address and you can have unlimited amounts of them.

CNAME records will always be pointed to a Domain name "www.exaple.com".

You can use A records or CNAME records without any restrictions as you want to, assuming your SOA and Nameservers is setup correctly.


I'm hoping someone can shed some light on DNS anames and cnames.
As I understand it:
- any domain can be an aname record, pointing at a single or multiple IP addresses
- top level domain names need to be anames (?)
- multiple anames can point at a single IP address (?)
- cnames can point at any aname or another cname
- cnames require the client to do multiple dns lookups until it hits an aname

Given the above, I assume I can have both server.example.com and www.server.example.com as anames pointing at a single IP address?
Is there any reason not to do this?
It's a small webserver with no email or anything fancy running on it.

Thanks :D
 
Thanks guys, that clears it up.

I'm trying to get 4 sub domain A records pointing at a single IP, but our DNS admin has just told me that "there can only be one A-name entry per IP for reverse lookups".

Would multiple PTR records be something to be concerned about?
All I can find online is a bug in "getnameinfo" that got patched in 2008, and that involved hundreds of PTRs.
 
For example:

A Record mail.yourserver.com 196.123.23.12
CName smtp.yourserver.com mail.yourserver.com
CName pop3.yourserver.com mail.yourserver.com


When requesting pop3.yourserver.com, it sends it to the mail.yourserver.com which resolves to 196.123.23.12

when you change your mail server, you update the IP, and Bob should be your uncle

But don't use smtp.yourserver.com in your MX record, use mail.yourserver.com.
MX records should point to A records, not CNAMES.
 
Tell your network admin that's why he's going to add it in the forward lookup zone :)
It will not screw up the current PTR in the reverse lookup zone pointing to the original name... nor add more PTR records, there will still only be one PTR...
 
Top
Sign up to the MyBroadband newsletter
X