We have a zone with a 2 hour TTL. Previous to making any changes it returned an A
record when looking up the entry for www
.
We changed the entry for www
to point to a CNAME
record. After the change, we noticed that the host command was returning both a CNAME
and an A
record as shown:
user@osx:~$ host www.example.com
www.example.com has address 192.168.1.2
www.example.com is an alias for vip.example.com.
www.example.com is an alias for vip.example.com.
user@osx:~$
Was this a problem with some DNS servers caching? If we had simply let the TTL fully expire, would we have gotten a CNAME
as expected with no A
record?
I didn't get any more detailed information with dig or other commands.
EDIT: The true address for vip.example.com.
is completely different from the A
record that was originally returned:
user@osx:~$ host vip.example.com
vip.example.com has address 172.16.4.5
user@osx:~$
Does a
dig +trace
show anything? It should show how it comes to the response you're getting.As far as I'm aware, this is perfectly normal. Querying a
CNAME
returns the value of theA
record, because this is ultimately where it's mapping to, when you're querying for anA
record.Being a Windows guy, I use
nslookup
. When the query type is set toA
I get:But when I set the query type to
CNAME
I get:Try setting the query type to
CNAME
instead ofA
and see what you get.Host is smart. It tries to display all the data it can to the user. However,
dig
is a much more reliable debugging tool.You should first identify whether or not the response you are getting starts at the nameservers or is further down the chain.