DNS Tools API

About

API Version: 1.2

The DNS Tools API allows you to look up DNS records for a given hostname.

The DNS Lookup tool currently supports these record types:

  • A (Host records)
  • CNAME (Canonical name records)
  • MX (Mail exchanger records)
  • NS (Name server records)
  • SOA (Start of authority records)
  • TXT (Text records)

DNS Lookup

Usage

Send a GET request to /api/dns/lookup/:hostname to get DNS records for the hostname.

Example - Browser:

https://networkcalc.com/api/dns/lookup/example.com

Example - cURL:

curl https://networkcalc.com/api/dns/lookup/example.com

Example - PowerShell:

(Invoke-RestMethod https://networkcalc.com/api/dns/lookup/example.com).records

Results
Name Type Description
status string The status of the request.
'OK' is a good request.
'NO_HOST_SPECIFIED' means you did not specify a hostname.
'INVALID_HOST' means the requested hostname is malformed.
'NO_RECORDS' means the hostname is valid, but the query returned no results.
hostname string The requested hostname.
records object An object containing all resolved DNS records for the host.
If no records of a given type were resolved, an empty array will be returned for the type.
See sample output below.
Sample Output
GET
https://networkcalc.com/api/dns/lookup/example.com

WHOIS Lookup

Usage

Send a GET request to /api/dns/whois/:hostname to get WHOIS records for the hostname.

Example - Browser:

https://networkcalc.com/api/dns/whois/example.com

Example - cURL:

curl https://networkcalc.com/api/dns/whois/example.com

Example - PowerShell:

(Invoke-RestMethod https://networkcalc.com/api/dns/whois/example.com).records

Results
Name Type Description
status string The status of the request.
'OK' is a good request.
'NO_HOST_SPECIFIED' means you did not specify a hostname.
'INVALID_HOST' means the requested hostname is malformed.
'NO_RESULT' means an unspecified error occurred or no results were available.
hostname string The requested hostname.
whois object An object containing all resolved WHOIS records for the host.
If no records of a given type were resolved, null will be returned for the type.
See sample output below.
whois.domain_status string The current status of the domain.
whois.domain_status_description string A description of the domain's current status.
whois.registrar string The registrar for the domain.
whois.registrar_iana_id integer The domain's unique identifier in the IANA database.
whois.registry_domain_id datetime The domain's unique identifier in the registry.
whois.registry_created_date datetime The date the current registration was created.
whois.registry_expiration_date string The date the registration expired or expires.
whois.abuse_email string The email address to contact for reporting abuse.
whois.abuse_phone string The phone number to contact for reporting abuse.
Sample Output
GET
https://networkcalc.com/api/dns/whois/networkcalc.com