Checking domain name availability with DNS records

后端 未结 8 798
你的背包
你的背包 2020-12-14 04:53

How accurately can a domain name\'s availibility be determined by checking for the existence of NS or SOA (Start of Authority)

8条回答
  •  予麋鹿
    予麋鹿 (楼主)
    2020-12-14 05:22

    If you plan to do bulk checks you will be soon disappointed by the built-in DNS resolver - it is synchronous. There is a nice cute library called ADNS (http://www.gnu.org/software/adns/) which offers asynchronous DNS queries. It is accompanied by a small command-line tool adnshost which I am using in combination with N-DJBDNS (http://pjp.dgplug.org/ndjbdns/) as a recursive resolver.

    The exact arguments are adnshost -a -tns -f

    The 4th column in the output will contain the result code:

    • 0 if there is at least 1 name server assigned for the domain (most registrars assign a default one until the owner assigns his own)
    • 300 or 301 if there are no name servers assigned

    Checking 1.2M domain names takes about 4-6 hours but this will vary with network speed/congestion.

提交回复
热议问题