Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have performed a dig on my domain name used on my site and I seem to be getting different results when I drop the "www." from the lookup. I am concerned this is causing me issues within my application, however i'm not sure if it's a red herring or not.

When I do this:

 dig @ www.php53.staging-crm.com

I get:

www.php53.staging-crm.com. 14400 IN A    165.160.xx.xx
www.php53.staging-crm.com. 14400 IN A    165.160.xx.xx

Similarly, when I drop the "www.":

 dig @ php53.staging-crm.com

I get:

php53.staging-crm.com. 14400 IN  A       80.75.xx.xx

(full IP addresses have been removed).

What would cause these to return different IP addresses?

share|improve this question
up vote 8 down vote accepted

Whatever dig reports is the truth. You should conclude that www.php53.staging-crm.com maps to 165.160.x.x and php53.staging-crm.com maps to 80.75.x.x.

There is no particular reason why they should map to the same address. It is common these days to have the unadorned domain name map to the same address as www for the convenience of web users, but that is nothing more than a convention. Your domain's entries just aren't defined that way now.

share|improve this answer
Within my application I use the PHP function fpassthru, within my hosts file I map to www.php53.staging-crm.com so I was concerned that as dig didn't report the same IP for both with and without the "www" then this could be an issue. – crmpicco Apr 17 '12 at 16:35
dig is a DNS lookup utility, and does exactly that. It ignores /etc/hosts. It ignores /etc/nsswitch.conf. Therefore, your web browser might get different results when it performs hostname-to-address lookups. – 200_success Apr 17 '12 at 19:48

Actually the domain name www.php53.staging-crm.com is the child domain of php53.staging-crm.com. They may or may not map to the same address. In your case both are mapped to two different IP addresses.

share|improve this answer
Do you believe this should be a problem if I have more than one instance of Apache? – crmpicco Apr 17 '12 at 16:46
I never thought about it that way but that makes an embarrassing amount of sense... – myol Apr 10 '15 at 11:21

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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