API 2.0 docs API 1.0 docs

A domain has a number of records associated with it, a DNS server can be queried to determine the IP address of the primary domain (A record), mail servers (MX records), DNS servers (NS nameservers) and other items such as SPF records (TXT records).

WhoisXmlApi.com provides RESTful APIs. It is designed for server-to-server communication between your system and the WhoisXmlApi.com network using standard HTTP or HTTPS protocols. Query responses are delivered in either XML or JSON format based on your requests which are made via GET/POST methods.

To get started you need a developer's account with WhoisXmlApi.com. Authentication is required each time in order to use the API.
The first 500 DNS lookups are complimentary when you register for a free developer account.

Making requests

GEThttps://www.whoisxmlapi.com/whoisserver/DNSService?apiKey=YOUR_API_KEY&domainName=bbc.com&type=1

It takes up to 2 minutes to activate your account after Sign Up.

Input parameters: required

apiKey
Get your personal API KEY on My products page.
domainName
The target domain name.
type
DNS type: A, NS, SOA, MX, etc. You can specify multiple comma-separated values, e.g., A,SOA,TXT; all records can be retrieved with "type=_all"

Acceptable values: A, NS, SOA, MX, etc.;

Input parameters: optional

outputFormat
Response output format.

Acceptable values: XML | JSON

Default: XML
callback
A javascript function used when outputFormat is JSON;
this is an implementation known as JSONP which invokes the callback on the returned response.

Free access

After Sign Up you automatically get a free subscription plan limited to 500 queries per month.

Sample output

JSON
XML
                            {
   "DNSData": {
      "domainName": "google.com",
      "types": [
         1,
         6,
         16
      ],
      "dnsTypes": "A,SOA,TXT",
      "audit": {
         "createdDate": "2019-05-07 14:45:22.916 UTC",
         "updatedDate": "2019-05-07 14:45:22.916 UTC"
      },
      "dnsRecords": [
         {
            "type": 16,
            "dnsType": "TXT",
            "name": "google.com.",
            "ttl": 299,
            "rRsetType": 16,
            "rawText": "google.com.\t\t299\tIN\tTXT\t\"globalsign-smime-dv=CDYX+XFHUw2wml6/Gb8+59BsH31KzUr6c1l2BPvqKX8=\"",
            "strings": [
               "globalsign-smime-dv=CDYX+XFHUw2wml6/Gb8+59BsH31KzUr6c1l2BPvqKX8="
            ]
         },
         {
            "type": 16,
            "dnsType": "TXT",
            "name": "google.com.",
            "ttl": 299,
            "rRsetType": 16,
            "rawText": "google.com.\t\t299\tIN\tTXT\t\"v=spf1 include:_spf.google.com ~all\"",
            "strings": [
               "v=spf1 include:_spf.google.com ~all"
            ]
         },
         {
            "type": 16,
            "dnsType": "TXT",
            "name": "google.com.",
            "ttl": 299,
            "rRsetType": 16,
            "rawText": "google.com.\t\t299\tIN\tTXT\t\"docusign=05958488-4752-4ef2-95eb-aa7ba8a3bd0e\"",
            "strings": [
               "docusign=05958488-4752-4ef2-95eb-aa7ba8a3bd0e"
            ]
         },
         {
            "type": 16,
            "dnsType": "TXT",
            "name": "google.com.",
            "ttl": 299,
            "rRsetType": 16,
            "rawText": "google.com.\t\t299\tIN\tTXT\t\"facebook-domain-verification=22rm551cu4k0ab0bxsw536tlds4h95\"",
            "strings": [
               "facebook-domain-verification=22rm551cu4k0ab0bxsw536tlds4h95"
            ]
         },
         {
            "type": 1,
            "dnsType": "A",
            "name": "google.com.",
            "ttl": 299,
            "rRsetType": 1,
            "rawText": "google.com.\t\t299\tIN\tA\t172.217.5.206",
            "address": "172.217.5.206"
         },
         {
            "type": 6,
            "dnsType": "SOA",
            "name": "google.com.",
            "ttl": 59,
            "rRsetType": 6,
            "rawText": "google.com.\t\t59\tIN\tSOA\tns1.google.com. dns-admin.google.com. 246997594 900 900 1800 60",
            "admin": "dns-admin.google.com.",
            "host": "ns1.google.com.",
            "expire": 1800,
            "minimum": 60,
            "refresh": 900,
            "retry": 900,
            "serial": 246997594
         }
      ]
   }
}
                        
                            <xml>
  <DNSData>
    <domainName>google.com</domainName>
    <types>
      <type>1</type>
      <type>6</type>
      <type>16</type>
    </types>
    <dnsTypes>A,SOA,TXT</dnsTypes>
    <audit>
      <createdDate>2019-05-07 14:45:48.363 UTC</createdDate>
      <updatedDate>2019-05-07 14:45:48.363 UTC</updatedDate>
    </audit>
    <dnsRecords>
      <dnsRecord>
        <type>16</type>
        <dnsType>TXT</dnsType>
        <name>google.com.</name>
        <ttl>299</ttl>
        <rRsetType>16</rRsetType>
        <rawText>google.com.		299	IN	TXT	"docusign=05958488-4752-4ef2-95eb-aa7ba8a3bd0e"</rawText>
        <strings>
          <string>docusign=05958488-4752-4ef2-95eb-aa7ba8a3bd0e</string>
        </strings>
      </dnsRecord>
      <dnsRecord>
        <type>16</type>
        <dnsType>TXT</dnsType>
        <name>google.com.</name>
        <ttl>299</ttl>
        <rRsetType>16</rRsetType>
        <rawText>google.com.		299	IN	TXT	"facebook-domain-verification=22rm551cu4k0ab0bxsw536tlds4h95"</rawText>
        <strings>
          <string>facebook-domain-verification=22rm551cu4k0ab0bxsw536tlds4h95</string>
        </strings>
      </dnsRecord>
      <dnsRecord>
        <type>16</type>
        <dnsType>TXT</dnsType>
        <name>google.com.</name>
        <ttl>299</ttl>
        <rRsetType>16</rRsetType>
        <rawText>google.com.		299	IN	TXT	"globalsign-smime-dv=CDYX+XFHUw2wml6/Gb8+59BsH31KzUr6c1l2BPvqKX8="</rawText>
        <strings>
          <string>globalsign-smime-dv=CDYX+XFHUw2wml6/Gb8+59BsH31KzUr6c1l2BPvqKX8=</string>
        </strings>
      </dnsRecord>
      <dnsRecord>
        <type>16</type>
        <dnsType>TXT</dnsType>
        <name>google.com.</name>
        <ttl>299</ttl>
        <rRsetType>16</rRsetType>
        <rawText>google.com.		299	IN	TXT	"v=spf1 include:_spf.google.com ~all"</rawText>
        <strings>
          <string>v=spf1 include:_spf.google.com ~all</string>
        </strings>
      </dnsRecord>
      <dnsRecord>
        <type>1</type>
        <dnsType>A</dnsType>
        <name>google.com.</name>
        <ttl>299</ttl>
        <rRsetType>1</rRsetType>
        <rawText>google.com.		299	IN	A	172.217.14.110</rawText>
        <address>172.217.14.110</address>
      </dnsRecord>
      <dnsRecord>
        <type>6</type>
        <dnsType>SOA</dnsType>
        <name>google.com.</name>
        <ttl>59</ttl>
        <rRsetType>6</rRsetType>
        <rawText>google.com.		59	IN	SOA	ns1.google.com. dns-admin.google.com. 246997594 900 900 1800 60</rawText>
        <admin>dns-admin.google.com.</admin>
        <host>ns1.google.com.</host>
        <expire>1800</expire>
        <minimum>60</minimum>
        <refresh>900</refresh>
        <retry>900</retry>
        <serial>246997594</serial>
      </dnsRecord>
    </dnsRecords>
  </DNSData>
</xml>
                        

Supported DNS Types

We support around fifty DNS types. You can use type codes or names from the table below:

Name Code Name Code
A1GPOS27
NS2AAAA28
MD3LOC29
MF4NXT30
CNAME5EID31
SOA6NIMLOC32
MB7SRV33
MG8ATMA34
MR9NAPTR35
NULL10KX36
WKS11CERT37
PTR12A638
HINFO13DNAME39
MINFO14APL42
MX15DS43
TXT16SSHFP44
RP17IPSECKEY45
AFSDB18RRSIG46
X2519NSEC47
ISDN20DNSKEY48
RT21DHCID49
NSAP22NSEC350
NSAP_PTR23NSEC3PARAM51
SIG24TLSA52
KEY25ANY255
PX26DLV32769

Account balance information

GEThttps://user.whoisxmlapi.com/service/account-balance?apiKey=YOUR_API_KEY
apiKey
Required. Get your personal API KEY on My products page.
productId
Optional. A list of the products' IDs can be found in the response.

- You can always check your account balance on the My products page. - Note that the following products use the same WHOIS credits: WHOIS API, Bulk WHOIS API, Domain Availability API. - Note that the following products use the same Domain Research Suite credits: Brand Alert API, Registrant Alert API, Reverse WHOIS API, WHOIS History API, Reverse IP/DNS API, Reverse MX API, Reverse NS API.

Account balance low or zero notification

When your account balance falls below certain level you will receive an email alert. Another email will be sent when your account balance reaches 0.

You can always change your notifications settings on the Settings - Notifications page.

Usage limits

The maximum number of requests per second is 30. In case that the limit is breached, your subsequent requests will be rejected until the next second.

TLDs supported

We support thousands of TLDs, both gTLDs and ccTLDS. You can see the entire list here.

Printable guide

You can also download the PDF version of this guide.

API status

You can check the API's current performance and availability status on the API Status Page.

Try our DNS Lookup API for free
Get started
Have questions?
support@whoisxmlapi.com
We will get back to you within a day.
WHOIS API, Inc.

California
USA

Contact us