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/