DNS Lookup

Cost: 1 credit(s) per call

Endpoint

GET /v1/dns/lookup/{domain}/{type}

The DNS Lookup API gives you direct access to the DNS records of any valid domain. Perfect for email deliverability checks, domain diagnostics, and automated infrastructure tools.

You can query common record types like A, MX, TXT, and NS, and get structured results that are easy to use in dashboards, validations, or scripts. Whether you're building a form validator, monitoring setup, or onboarding flow, this API lets you inspect domains without relying on CLI tools or bloated integrations.

Parameters

HeaderInTypeRequiredDescription
AuthorizationheaderstringYesAPI Key from your console.
Content-TypeheaderstringYesMust be application/json.
typepathstringYesDNS record type. Allowed values: A, AAAA, CNAME, MX, NS, PTR, SOA, SRV, TXT, SPF
domainpathstringYesThe domain name to perform the DNS lookup on. Must be a valid domain format.

JSON Response

{
  "success": true,
  "data": [
    "mx1.mailserver.com.",
    "mx2.mailserver.com."
  ]
}

Response Fields

FieldTypeDescription
successbooleanIndicates whether the DNS lookup was successful.
datastring[]An array of DNS records returned for the specified domain and type.
errorstringPresent only on failure. Describes the reason for the error.

Code Snippets

Code ready to go! Select one of your API keys to fill in the code  

Login to see your API keys or  Register for a free account and up to 1000 free credits.

Note: You can also try it in our API playground



curl -X GET "https://api.wyldapi.com/v1/dns/lookup/example.com/MX" \
     -H "Authorization: Bearer <YOUR_TOKEN>"


import requests

url = "https://api.wyldapi.com/v1/dns/lookup/example.com/MX"
headers = {
    "Authorization": "Bearer <YOUR_TOKEN>"
}

response = requests.get(url, headers=headers)
print(response.json())


<?php
$ch = curl_init();

curl_setopt($ch, CURLOPT_URL, "https://api.wyldapi.com/v1/dns/lookup/example.com/MX");
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_HTTPHEADER, [
    "Authorization: Bearer <YOUR_TOKEN>"
]);

$response = curl_exec($ch);
curl_close($ch);

print_r(json_decode($response, true));
?>


fetch("https://api.wyldapi.com/v1/dns/lookup/example.com/MX", {
  method: "GET",
  headers: {
    "Authorization": "Bearer <YOUR_TOKEN>"
  }
})
  .then(response => response.json())
  .then(data => console.log(data))
  .catch(error => console.error("Error:", error));


import React, { useEffect } from "react";
import axios from "axios";

const DNSLookup = () => {
  useEffect(() => {
    axios.get("https://api.wyldapi.com/v1/dns/lookup/example.com/MX", {
      headers: {
        Authorization: "Bearer <YOUR_TOKEN>"
      }
    })
    .then(response => console.log(response.data))
    .catch(error => console.error("Error:", error));
  }, []);

  return <div>Check console for DNS results</div>;
};

export default DNSLookup;