Why is the host command returning both an A and a CNAME record

cachedomain-name-system

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:~$ 

Best Answer

Does a dig +trace show anything? It should show how it comes to the response you're getting.

Related Topic