DNS Lookup Code Examples

Domain Intelligence and Analysis
POST /api/v1/domain/dns Bearer

Ready-to-run DNS Lookup calls. Replace YOUR_API_KEY with the key from your dashboard.

DNS Lookup — Code Samples

cURL
PHP
Fetch
jQuery
Axios
Python
curl -X POST https://app.way2api.com/api/v1/domain/dns \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"domain_name":"google.com","record_type":"all"}'

Expected Response — 200

{
    "status": "SUCCESS",
    "status_code": 200,
    "charged": true,
    "success": true,
    "message": "",
    "message_code": "OK",
    "order_id": "W2A1739512345abcdef01",
    "data": {
        "order_id": "W2A1739512345abcdef01",
        "result": {
            "domain_name": "google.com",
            "is_registered": true,
            "record_types": [
                "A",
                "NS",
                "SOA",
                "MX",
                "TXT",
                "AAAA",
                "SPF"
            ],
            "records": [
                {
                    "name": "google.com",
                    "type": "A",
                    "ttl": 300,
                    "value": "142.250.102.138",
                    "priority": 0,
                    "raw": "google.com.\t\t300\tIN\tA\t142.250.102.138"
                },
                {
                    "name": "google.com",
                    "type": "A",
                    "ttl": 300,
                    "value": "142.250.102.139",
                    "priority": 0,
                    "raw": "google.com.\t\t300\tIN\tA\t142.250.102.139"
                },
                {
                    "name": "google.com",
                    "type": "A",
                    "ttl": 300,
                    "value": "142.250.102.101",
                    "priority": 0,
                    "raw": "google.com.\t\t300\tIN\tA\t142.250.102.101"
                },
                {
                    "name": "google.com",
                    "type": "A",
                    "ttl": 300,
                    "value": "142.250.102.102",
                    "priority": 0,
                    "raw": "google.com.\t\t300\tIN\tA\t142.250.102.102"
                }
            ],
            "queried_at": "2026-08-04 13:32:43"
        }
    }
}