Why do Ping and Dig provide different IP address than nslookup?

Posted by user1032531 on Super User See other posts from Super User or by user1032531
Published on 2013-10-21T17:15:34Z Indexed on 2013/10/22 10:01 UTC
Read the original article Hit count: 505

Filed under:
|
|

When pinging my domain name which points to my home public IP from two different servers on my LAN, it shows them pinging different IP. Further investigation shows dig and nslookup providing different results. See below.

A little history. My IP used to be 11.22.33.444 and is hosted by Comcast. I changed routers, and it somehow got changed to 55.66.77.888. I've since updated my 1and1 domain name to point to the 55.66.77.888. desktop is a basic server, runs the web server, and connects wirelessly to my LAN. laptop is a GUI and connected via CAT5. Both operate Centos6.4. My old router was a D-Link, and used their "Virtual Server" feature to pass port 80 to desktop. My new router is a Linksys, and I use their "Port Forwarding" feature to pass port 80 to desktop (however, I haven't gotten this part working yet).

What is going on??? Why the different IPs? Obviously, it most somehow be stored on the server, but why does the actual machine even know the public IP since it is on a LAN? How do I purge the old IP?

[root@desktop etc]# dig +short myDomain.com
11.22.33.444
[root@desktop etc]# nslookup www.myDomain.com
Server:         8.8.8.8
Address:        8.8.8.8#53

Non-authoritative answer:
Name:   www.myDomain.com
Address: 55.66.77.888

[root@desktop etc]# dig myDomain.com

; <<>> DiG 9.8.2rc1-RedHat-9.8.2-0.17.rc1.el6_4.6 <<>> myDomain.com
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 13822
;; flags: qr rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 0, ADDITIONAL: 0

;; QUESTION SECTION:
;myDomain.com.                    IN      A

;; ANSWER SECTION:
myDomain.com.             16031   IN      A       11.22.33.444

;; Query time: 21 msec
;; SERVER: 8.8.8.8#53(8.8.8.8)
;; WHEN: Mon Oct 21 04:36:52 2013
;; MSG SIZE  rcvd: 44

[root@desktop etc]#


[root@laptop ~]# dig +short myDomain.com
55.66.77.888
[root@laptop ~]# nslookup www.myDomain.com
Server:         192.168.0.1
Address:        192.168.0.1#53

Non-authoritative answer:
Name:   www.myDomain.com
Address: 55.66.77.888

[root@laptop ~]#

© Super User or respective owner

Related posts about linux

Related posts about networking