Add to Favourites Add to Favourites    Print this Article Print this Article

Testing your DNS IPs from /etc/resolv.conf

If you get DNS lookup errors, it might be invalid IPs set in the file:

/etc/resolv.conf

The resolver will start at the first "nameserver" entry and work it's way down.

A sample /etc/resolv.conf might look like

nameserver 8.8.8.8
nameserver 8.8.4.4



You might have IPs specified listed by your datacenter, to use their nameservers.

To test the lookup the record of a domain: with a specific DNS IP: , set the values you want, and run the following:

dig A google.com @8.8.8.8



You might get output like this:

[root@es6-64 ~]# dig A google.com @8.8.8.8

; <<>> DiG 9.7.0-P2-RedHat-9.7.0-5.P2.el6 <<>> A google.com @8.8.8.8
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 15679
;; flags: qr rd ra; QUERY: 1, ANSWER: 16, AUTHORITY: 0, ADDITIONAL: 0

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

;; ANSWER SECTION:
google.com.             207     IN      A       216.123.194.119

;; Query time: 34 msec
;; SERVER: 8.8.8.8#53(8.8.8.8)
;; WHEN: Mon Sep 28 00:09:49 2015
;; MSG SIZE  rcvd: 284



Where the value you're looking for is the IP under the ;; ANSWER SECTION.

Was this answer helpful?

Also Read