Sign up ×
Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

Can anyone tell me why this is happening? I can resolve a hostname using host and/or nslookup but forward lookups do not work with dig; reverse lookups do:

musashixxx@box:~$ host someserver
someserver.somenet.internal has address
musashixxx@box:~$ host domain name pointer someserver.somenet.internal.
musashixxx@box:~$ nslookup someserver

Name:   someserver.somenet.internal
musashixxx@box:~$ nslookup
Address:  name = someserver.somenet.internal.

musashixxx@box:~$ dig someserver

; <<>> DiG 9.8.1-P1 <<>> someserver
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: SERVFAIL, id: 55306
;; flags: qr rd ra; QUERY: 1, ANSWER: 0, AUTHORITY: 0, ADDITIONAL: 0

;someserver.            IN  A

;; Query time: 0 msec
;; WHEN: Wed Oct  3 15:47:38 2012
;; MSG SIZE  rcvd: 27

musashixxx@box:~$ dig -x

; <<>> DiG 9.8.1-P1 <<>> -x
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 28126
;; flags: qr aa rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 0, ADDITIONAL: 0

;    IN  PTR

;; ANSWER SECTION: 3600 IN PTR someserver.somenet.internal.

;; Query time: 0 msec
;; WHEN: Wed Oct  3 15:49:11 2012
;; MSG SIZE  rcvd: 86

Here's what my resolv.conf looks like:

search somenet.internal

Is this behavior normal? Any thoughts?

share|improve this question

2 Answers 2

up vote 13 down vote accepted

It's the default behaviour of dig not to use the search-option.

From the manual page:

       Use [do not use] the search list defined by the searchlist or
       domain directive in resolv.conf (if any). The search list is not
       used by default.

Edit: Just add +search to make it work, like dig +search myhost.

share|improve this answer
Am I the only one who sees that as being a little counter-intuitive? :-) Anyway, thanks a lot! – musashiXXX Oct 3 '12 at 22:03
@musashiXXX Well, it depends :-) Most people use dig for debugging DNS and in this case it's quite a good idea to disable everything which might mess up the answers from DNS. I think it's a pretty good idea; most people use host and nslookup after all. :-) – Alexander Janssen Oct 3 '12 at 22:06

I was having the same problem. After inspecting packets sent from both nslookup and dig with wireshark, I found the problem.

dig was setting the authentic data bit in the query. According to the man page, "This requests the server to return whether all of the answer and authority sections have all been validated as secure according to the security policy of the server." By running dig with +noadflag, it returned the same results as nslookup.

share|improve this answer

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.