LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Networking (https://www.linuxquestions.org/questions/linux-networking-3/)
-   -   DIG, why it's behaving like this... (https://www.linuxquestions.org/questions/linux-networking-3/dig-why-its-behaving-like-this-867775/)

LucL 03-10-2011 02:45 PM

DIG, why it's behaving like this...
 
Quick question guys...

I'm working on a Java based DNS scanner that checks the actual name servers (ns record) for a particular domain. I've ran into a problem where some domains simply can't be checked, although they do have a name server.

Anyways, dig seems to be able to check them, but only if I run it without any paramaters...

ex:

dig ns amnhac24h.us

# dig ns amnhac24h.us

; <<>> DiG 9.3.4-P1 <<>> ns amnhac24h.us
;; global options: printcmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: SERVFAIL, id: 29686
;; flags: qr rd ra; QUERY: 1, ANSWER: 0, AUTHORITY: 0, ADDITIONAL: 0

;; QUESTION SECTION:
;amnhac24h.us. IN NS

;; Query time: 64 msec
;; SERVER: 65.182.168.10#53(65.182.168.10)
;; WHEN: Thu Mar 10 15:09:58 2011
;; MSG SIZE rcvd: 30

but

dig amnhac24h.us


; <<>> DiG 9.3.4-P1 <<>> amnhac24h.us
;; global options: printcmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 43897
;; flags: qr rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 2, ADDITIONAL: 0

;; QUESTION SECTION:
;amnhac24h.us. IN A

;; ANSWER SECTION:
amnhac24h.us. 84030 IN A 174.120.120.196

;; AUTHORITY SECTION:
amnhac24h.us. 2012 IN NS SK.S5.BNS1.NS96.SEARCHREINVENTED.COM.
amnhac24h.us. 2012 IN NS SK.S5.BNS2.NS96.SEARCHREINVENTED.COM.

;; Query time: 1 msec
;; SERVER: 65.182.168.10#53(65.182.168.10)
;; WHEN: Thu Mar 10 15:10:19 2011
;; MSG SIZE rcvd: 121

Any idea why an NS lookup would fail (just on this domain), while dig lookup without any parameters works?

I checked the .us zone file, and there is a name server record for this domain.

PS, I checked 5 of the most popular DNS libraries for Java and they all fail NS loookups on certain domains (ex: amnhac24h.us, adoptanolympian.org).

Thanks,
Luc

acid_kewpie 03-10-2011 03:12 PM

can you provide more detailed output? You've got the first half of a dig for the first bit, and the second part for the second.

LucL 03-10-2011 03:14 PM

Updated with complete output from dig.


All times are GMT -5. The time now is 11:21 PM.