Unified & Consistent
Whois API & Whois
DNS Lookup API User Guide
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 lookup calls are complimentary when you register for a free developer account.
Making a Call to DNS Lookup API Web Service
Supported input parameters
|domainName||required, the domain for which DNS data is requested|
|username||required unless ApiKey authentication is used, your account username|
required unless ApiKey authentication is used, your account
make sure it is URL-encoded if it contains special characters (&, %, * etc.)
|requestObject||required unless password authentication is used, encoded user identifier for ApiKey authentication|
|digest||required unless password authentication is used, ApiKey access token|
required, 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
|outputFormat||XML | JSON (defaults to XML)|
this is an implementation known as JSONP which invokes the callback on the returned response
Supported DNS Types
We support around fifty DNS types. You can use type codes or names from the table below:
Usage of HTTP & HTTPS
You can use both http and https to make the API query. With HTTPs the connection would be more secure but slightly slower.
Sample code for making a query to DNS Lookup API Web Service
You may view examples of querying DNS Lookup API by clicking on the following links or visiting our GitHub page
User password authentication
NodeJS : example
PHP : example
PowerShell : example
Python : example
API key authentication
The maximum number of requests per second is 1. In case that the limit is breached (either from single IP address or from multiple IPs), you will be penalized with the 30 second ban. That ban includes IPs that were used at the time of the offence, and includes all following IPs (based on username from additional requests) used during the ban time.
Query Account Balance Information
Supported input parameters
required, type of service;
in this case, "accountBalance"
|username||required, your account username|
|password||required, your account password;
make sure it is if it contains special characters (&, %, * etc.)
|output_format||XML | JSON (defaults to XML)|
You will receive a response with your account balance.
Password authenticationThis method uses your account's username and password to authenticate with the web service. Just pass your credentials as query string parameters (username, password).
API key authenticationGenerate access tokens providing your API and secret keys to make DNS Lookup API calls without sending your username and password. These tokens will need to be included as part of the request URL (requestObject, digest). Please, note that all tokens expire after 5 minutes and will have to be regenerated. Access the API Key Management section of your account to create your keys (make sure the key you're using is marked as active).
We support thousands of TLDs, both gTLDs and ccTLDS. You can see the entire list here.
You can also download the PDF version of this guide.