REST · OpenAPI 3.1

DNS Lookup API

Query DNS by domain and record type to retrieve structured records, nameservers and lookup errors for domain configuration checks.

  • Results include retrieved records and errors. Caching and DNS propagation can cause temporary differences; verify configuration with the registrar or DNS provider when needed.
  • 1 credit per successful task
  • 10 external calls / minute / account
Response preview

example.com

What is the DNS Lookup API?

Query DNS by domain and record type to retrieve structured records, nameservers and lookup errors for domain configuration checks.

Use cases

  • Custom domain onboarding

    Verify DNS records when customers connect a custom domain to your product.

  • Domain and email migrations

    Check relevant DNS records after a domain migration or email provider change.

  • DNS troubleshooting

    Investigate DNS records when a website or email service has connectivity problems.

Playground

Send a live API request and inspect its job status and response.

Input
Loading…

Fill in the fields below. Switch to JSON only when you need to edit the raw request.

Domain or lookup target.

Type

Output
Run the API to see its response.

Reference

Replace the example key with one created in your console. The input demonstrates integration; consult the API documentation for all fields and validation rules. API docs

Request example
POST /openapi/v1/tools/1ms/dns/execute
curl 'https://1ms.tools/openapi/v1/tools/1ms/dns/execute' \
  -H 'Authorization: Bearer YOUR_API_KEY' \
  -H 'Content-Type: application/json' \
  -H 'Idempotency-Key: YOUR_UNIQUE_REQUEST_ID' \
  -d '{"domain":"example.com","type":"all"}'

JSON request parameters

FieldTypeRequiredDetected page description; may be null.
domainstringRequiredDomain or lookup target.
typestringRequiredType

Fields in data.result

FieldTypeDetected page description; may be null.
domainstringDomain or lookup target.
statusstringProvider or protocol status.
resolverstringResolver or data source used for the DNS response.
recordsarrayNormalized DNS records with type, owner name, TTL and value.

Response example

Illustrative contract example. Not a live lookup or captured registry record.
{
  "code": 0,
  "message": "ok",
  "data": {
    "id": "JOB_ID",
    "status": "succeeded",
    "result": {
      "domain": "example.com",
      "status": "NOERROR",
      "resolver": "1ms",
      "records": [
        {
          "type": "A",
          "name": "example.com.",
          "ttl": null,
          "value": "192.0.2.1"
        }
      ]
    },
    "error": null,
    "creditCost": 1,
    "creditsRefunded": false,
    "pollAfterMs": 6000,
    "statusUrl": "/openapi/v1/jobs/JOB_ID"
  }
}
Asynchronous response and result retrieval
Wait at least six seconds before polling with the same key. Read result on succeeded, or error on failed or canceled.
curl 'https://1ms.tools/openapi/v1/jobs/JOB_ID' \
  -H 'Authorization: Bearer YOUR_API_KEY'

Results include retrieved records and errors. Caching and DNS propagation can cause temporary differences; verify configuration with the registrar or DNS provider when needed.

Errors your code should handle

Job execution errors appear in data.error on a failed job. A successful status lookup can still return HTTP 200.

400Invalid input; no job or credit reservation.
401Missing, invalid, revoked or expired API key.
402Insufficient account credits; no job created.
404Resource unavailable or owned by another account.
409Idempotency conflict, or job cannot be canceled.
429Account rate limit reached. Wait for Retry-After.
500Submission interrupted. Retry with the original idempotency key.
Use DNS Lookup API from your agent
Call the execute tool execute_1ms/dns through the shared 1ms.tools MCP server or Agent Skill. Same API key and price: 1 credit per successful task.

FAQ

Query DNS by domain and record type to retrieve structured records, nameservers and lookup errors for domain configuration checks.

Results include retrieved records and errors. Caching and DNS propagation can cause temporary differences; verify configuration with the registrar or DNS provider when needed.

Yes. Connect the MCP server with an API key or browser OAuth authorization, or install the downloadable Agent Skill. These entries use asynchronous jobs and the same account credits and rate limit.

Use Authorization: Bearer YOUR_API_KEY or X-API-Key. External endpoints require a valid key; browser cookies cannot replace it. Keep keys on a server or in a trusted application environment.

Creating a job reserves 1 credit, finalized on success. Invalid input or insufficient credits creates no job and incurs no charge. Polling costs no credits but counts toward the rate limit.

If a job fails, times out on the server, or is canceled while queued, all reserved credits are automatically returned to your account. No request is needed. Successful jobs are charged normally. Only queued jobs can be canceled; closing the page or a client request timing out does not mean the job was canceled or failed. Check the final job status and creditsRefunded field, and view the refund in your credit history.

This endpoint uses asynchronous jobs, returning HTTP 202 and a job ID first. Poll the returned statusUrl and read result on success. Use Idempotency-Key for submission retries.

Each account can make 10 external business requests per calendar minute, shared by all keys and counted separately from web requests. Polling, uploads and execution all count; respect Retry-After on HTTP 429.