DNS Lookup
Standard · 1 creditLook up DNS records for a domain, optionally filtering to specific record types.
POST /api/dns-lookup
Section titled “POST /api/dns-lookup”Parameters
Section titled “Parameters”| Field | Type | Required | Description |
|---|---|---|---|
domain | string | Yes | Domain name to query |
record_types | array | No | Record types to query: A, AAAA, MX, NS, TXT, CNAME. Defaults to all |
Response
Section titled “Response”| Field | Type | Description |
|---|---|---|
domain | string | Queried domain |
records | object | Map of record type to array of records |
records[type][].value | string | Record value |
records[type][].priority | integer | Priority (MX records only) |
query_time | string | Query duration |
Examples
Section titled “Examples”All records
Section titled “All records”curl -X POST https://morso.dev/api/dns-lookup \ -H "Authorization: Bearer YOUR_API_KEY" \ -H "Content-Type: application/json" \ -d '{"domain": "example.com"}'{ "domain": "example.com", "records": { "A": [{"value": "93.184.216.34"}], "AAAA": [{"value": "2606:2800:220:1:248:1893:25c8:1946"}], "MX": [{"value": "mail.example.com", "priority": 10}], "NS": [{"value": "a.iana-servers.net"}, {"value": "b.iana-servers.net"}], "TXT": [{"value": "v=spf1 -all"}] }, "query_time": "45ms"}Specific record types
Section titled “Specific record types”curl -X POST https://morso.dev/api/dns-lookup \ -H "Authorization: Bearer YOUR_API_KEY" \ -H "Content-Type: application/json" \ -d '{"domain": "example.com", "record_types": ["MX", "TXT"]}'{ "domain": "example.com", "records": { "MX": [{"value": "mail.example.com", "priority": 10}], "TXT": [{"value": "v=spf1 -all"}] }, "query_time": "22ms"}