[62869] in North American Network Operators' Group
Re: Detecting a non-existent domain
daemon@ATHENA.MIT.EDU (Dominic J. Eidson)
Tue Sep 23 17:33:38 2003
Date: Tue, 23 Sep 2003 16:24:32 -0500 (CDT)
From: "Dominic J. Eidson" <sauron@the-infinite.org>
To: Kee Hinckley <nazgul@somewhere.com>
Cc: <nanog@merit.edu>
In-Reply-To: <p0610021ebb966134c8d2@[192.168.1.104]>
Errors-To: owner-nanog-outgoing@merit.edu
On Tue, 23 Sep 2003, Kee Hinckley wrote:
> Getting practical for a minute. What is the optimal way now to see
> if a given host truly exists? Assume that I can't control the DNS
Look for a SOA record for the domain - this should be the proper way to
check for the existance of a domain, instead of looking for A, NS or MX
records..
box:~# dig assvsvsdcacdasc.com SOA
; <<>> DiG 9.1.3 <<>> assvsvsdcacdasc.com SOA
;; global options: printcmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 47940
;; flags: qr rd ra; QUERY: 1, ANSWER: 0, AUTHORITY: 1, ADDITIONAL: 0
;; QUESTION SECTION:
;assvsvsdcacdasc.com. IN SOA
;; AUTHORITY SECTION:
com. 10800 IN SOA a.gtld-servers.net. nstld.verisign-grs.com. 2003092300 1800 900 604800 86400
box:~# dig yahoo.com SOA
; <<>> DiG 9.1.3 <<>> yahoo.com SOA
;; global options: printcmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 50827
;; flags: qr rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 5, ADDITIONAL: 0
;; QUESTION SECTION:
;yahoo.com. IN SOA
;; ANSWER SECTION:
yahoo.com. 1800 IN SOA hidden-master.yahoo.com. hostmaster.yahoo-inc.com. 2003092304 900 300 604800 600
Note the difference in QUERY and ANSWER numbers for the two...
- d.
--
Dominic J. Eidson
"Baruk Khazad! Khazad ai-menu!" - Gimli
-------------------------------------------------------------------------------
http://www.the-infinite.org/