> For the complete documentation index see https://domscan.net/llms.txt. Markdown versions of every docs page are available by appending .md to the page URL.

Source: https://domscan.net/pt/docs/products/dns-lookup

# API de Consulta de DNS

Execute consultas de DNS para qualquer tipo de registo. Use esta referência para escolher o endpoint certo e ver exatamente o que ele retorna.

[Ver página do produto](https://domscan.net/pt/dns-lookup-api)

## Operações

GET `/v1/dns` [Ver referência da API](https://domscan.net/pt/docs/products/dns-lookup#getDnsRecords)

GET `/v1/dns/all` [Ver referência da API](https://domscan.net/pt/docs/products/dns-lookup#getAllDnsRecords)

GET `/v1/dns/history` [Ver referência da API](https://domscan.net/pt/docs/products/dns-lookup#getDnsHistory)

## GET `/v1/dns`

Operação: `getDnsRecords`
Créditos e autenticação: 1
Autenticação obrigatória

GET /v1/dns Créditos: 1

#### Parâmetros de consulta

| Parâmetro | Tipo | obrigatório |
| --- | --- | --- |
| domain | string | obrigatório |
| type | string Valores permitidos `A`, `AAAA`, `MX`, `NS`, `TXT`, `SOA`, `CNAME`, `CAA`, `PTR`, `SRV`, `ALL` Padrão `A` | opcional |

#### Campos da resposta

#### Exemplo de requisição

```bash
curl -H "X-API-Key: $DOMSCAN_API_KEY" "https://domscan.net/v1/dns?domain=example.com&type=A"
```

```javascript
const response = await fetch("https://domscan.net/v1/dns?domain=example.com&type=A", {
  headers: { "X-API-Key": process.env.DOMSCAN_API_KEY },
});
const data = await response.json();
console.log(data);
```

```python
import os
import requests

response = requests.get(
    "https://domscan.net/v1/dns?domain=example.com&type=A",
    headers={"X-API-Key": os.environ["DOMSCAN_API_KEY"]},
)
print(response.json())
```

```go
package main

func main() {
	req, err := http.NewRequest(http.MethodGet, "https://domscan.net/v1/dns?domain=example.com&type=A", nil)
	if err != nil {
		panic(err)
	}
	req.Header.Set("X-API-Key", os.Getenv("DOMSCAN_API_KEY"))

```ruby
require "json"
require "net/http"

uri = URI("https://domscan.net/v1/dns?domain=example.com&type=A")
request = Net::HTTP::Get.new(uri)
request["X-API-Key"] = ENV.fetch("DOMSCAN_API_KEY")

#### Exemplo de resposta

```json
{
  "domain": "google.com",
  "record_type": "TXT",
  "records": [
    {
      "type": "TXT",
      "name": "google.com",
      "data": "v=spf1 include:_spf.google.com ~all",
      "ttl": 300,
      "classification": "spf"
    },
    {
      "type": "TXT",
      "name": "google.com",
      "data": "google-site-verification=abc123",
      "ttl": 300,
      "classification": "verification"
    }
  ],
  "status": "success",
  "dnssec_validated": false,
  "query_time_ms": 37,
  "checked_at": "2026-04-18T21:00:00Z",
  "warnings": [
    {
      "code": "TXT_MULTIPLE_RESPONSES",
      "message": "Domain publishes multiple TXT records; use classification to isolate the security ones.",
      "severity": "info"
    }
  ],
  "meta": {
    "served_by": "pop=unknown country=unknown"
  }
}
```

#### Códigos de status HTTP

- `200` OK
- `400` Pedido inválido
- `401` Não autorizado
- `402` Pagamento necessário
- `429` Demasiados pedidos

## GET `/v1/dns/all`

Operação: `getAllDnsRecords`
Créditos e autenticação: 2
Autenticação obrigatória

GET /v1/dns/all Créditos: 2

#### Parâmetros de consulta

| Parâmetro | Tipo | obrigatório |
| --- | --- | --- |
| domain | string | obrigatório |
| wildcard_probe | string Valores permitidos `1` | opcional |

#### Campos da resposta

| Campo | Tipo |
| --- | --- |
| `domain` | string |
| `records` | object |
| `summary` | object |
| `summary.has_a` | boolean \| null |
| `summary.has_aaaa` | boolean \| null |
| `summary.has_ns` | boolean \| null |
| `summary.has_mx` | boolean \| null |
| `summary.has_txt` | boolean \| null |
| `summary.has_https` | boolean \| null |
| `summary.has_svcb` | boolean \| null |
| `summary.ipv6_parity` | string |
| `failed_types[]` | string[] |
| `warnings[]` | object[] |
| `warnings[]` | object |
| `warnings[].code` | string |
| `warnings[].message` | string |
| `warnings[].severity` | string |
| `wildcard` | object |
| `wildcard.suspected` | boolean |
| `wildcard.probe_label` | string |
| `query_time_ms` | integer |
| `checked_at` | string |
| `meta` | object |
| `meta.served_by` | string |

#### Exemplo de requisição

```bash
curl -H "X-API-Key: $DOMSCAN_API_KEY" "https://domscan.net/v1/dns/all?domain=example.com&wildcard_probe=1"
```

```javascript
const response = await fetch("https://domscan.net/v1/dns/all?domain=example.com&wildcard_probe=1", {
  headers: { "X-API-Key": process.env.DOMSCAN_API_KEY },
});
const data = await response.json();
console.log(data);
```

```python
import os
import requests

response = requests.get(
    "https://domscan.net/v1/dns/all?domain=example.com&wildcard_probe=1",
    headers={"X-API-Key": os.environ["DOMSCAN_API_KEY"]},
)
print(response.json())
```

```go
package main

func main() {
	req, err := http.NewRequest(http.MethodGet, "https://domscan.net/v1/dns/all?domain=example.com&wildcard_probe=1", nil)
	if err != nil {
		panic(err)
	}
	req.Header.Set("X-API-Key", os.Getenv("DOMSCAN_API_KEY"))

```ruby
require "json"
require "net/http"

uri = URI("https://domscan.net/v1/dns/all?domain=example.com&wildcard_probe=1")
request = Net::HTTP::Get.new(uri)
request["X-API-Key"] = ENV.fetch("DOMSCAN_API_KEY")

#### Exemplo de resposta

```json
{
  "domain": "openai.com",
  "records": {
    "A": [
      {
        "type": "A",
        "name": "openai.com",
        "data": "104.18.33.45",
        "ttl": 300
      }
    ],
    "AAAA": [
      {
        "type": "AAAA",
        "name": "openai.com",
        "data": "2606:4700::6812:212d",
        "ttl": 300
      }
    ],
    "MX": [
      {
        "type": "MX",
        "name": "openai.com",
        "data": "aspmx.l.google.com",
        "ttl": 300,
        "priority": 1
      }
    ],
    "NS": [
      {
        "type": "NS",
        "name": "openai.com",
        "data": "ns1-02.azure-dns.com",
        "ttl": 172800
      },
      {
        "type": "NS",
        "name": "openai.com",
        "data": "ns2-02.azure-dns.net",
        "ttl": 172800
      }
    ],
    "TXT": [
      {
        "type": "TXT",
        "name": "openai.com",
        "data": "v=spf1 include:_spf.google.com ~all",
        "ttl": 300,
        "classification": "spf"
      },
      {
        "type": "TXT",
        "name": "openai.com",
        "data": "v=TLSRPTv1; rua=mailto:tlsrpt@openai.com",
        "ttl": 300,
        "classification": "tls_rpt"
      }
    ]
  },
  "summary": {
    "has_a": true,
    "has_aaaa": true,
    "has_ns": true,
    "has_mx": true,
    "has_txt": true,
    "has_https": false,
    "has_svcb": false,
    "ipv6_parity": "full"
  },
  "warnings": [
    {
      "code": "MX_PRIORITY_SHARED",
      "message": "Multiple MX hosts share the same priority.",
      "severity": "info"
    }
  ],
  "wildcard": {
    "suspected": false,
    "probe_label": "_domscan-probe-4f6a2c.openai.com"
  },
  "query_time_ms": 82,
  "checked_at": "2026-04-18T21:00:00Z"
}
```

#### Códigos de status HTTP

- `200` OK
- `400` Pedido inválido
- `401` Não autorizado
- `402` Pagamento necessário
- `429` Demasiados pedidos

## GET `/v1/dns/history`

Operação: `getDnsHistory`
Créditos e autenticação: 3
Autenticação obrigatória

GET /v1/dns/history Créditos: 3

#### Parâmetros de consulta

| Parâmetro | Tipo | obrigatório |
| --- | --- | --- |
| domain | string | obrigatório |
| type | string | opcional |
| from | string | opcional |
| to | string | opcional |
| limit | integer Padrão `100` | opcional |
| cursor | string | opcional |

#### Campos da resposta

| Campo | Tipo |
| --- | --- |
| `has_more` | boolean |
| `next_cursor` | string \| null |
| `domain` | string |
| `history[]` | object[] |
| `history[]` | object |
| `history[].date` | string |
| `history[].record_type` | string |
| `history[].changes[]` | object[] |
| `history[].changes[]` | object |
| `history[].changes[].action` | string |
| `history[].changes[].value` | string |
| `history[].changes[].ttl` | integer \| null |
| `current_records` | object |
| `first_seen` | string \| null |
| `last_seen` | string \| null |
| `total_changes` | integer |
| `record_types_tracked[]` | string[] |
| `beta_notice` | string |
| `meta` | object |
| `meta.note` | string |
| `meta.data_source` | string |
| `meta.history_limit` | integer |
| `meta.history_rows_evaluated` | integer |
| `meta.history_rows_truncated` | boolean |
| `meta.removal_confirmation_days` | integer |
| `meta.current_records_scope` | string |

#### Exemplo de requisição

```bash
curl -H "X-API-Key: $DOMSCAN_API_KEY" "https://domscan.net/v1/dns/history?domain=example.com&type=A&from=2026-01-01&to=2026-04-15&limit=10"
```

```javascript
const response = await fetch("https://domscan.net/v1/dns/history?domain=example.com&type=A&from=2026-01-01&to=2026-04-15&limit=10", {
  headers: { "X-API-Key": process.env.DOMSCAN_API_KEY },
});
const data = await response.json();
console.log(data);
```

```python
import os
import requests

response = requests.get(
    "https://domscan.net/v1/dns/history?domain=example.com&type=A&from=2026-01-01&to=2026-04-15&limit=10",
    headers={"X-API-Key": os.environ["DOMSCAN_API_KEY"]},
)
print(response.json())
```

```go
package main

import (
	"fmt"
	"io"
	"net/http"
	"os"
)

func main() {
	req, err := http.NewRequest(http.MethodGet, "https://domscan.net/v1/dns/history?domain=example.com&type=A&from=2026-01-01&to=2026-04-15&limit=10", nil)
	if err != nil {
		panic(err)
	}
	req.Header.Set("X-API-Key", os.Getenv("DOMSCAN_API_KEY"))

	resp, err := http.DefaultClient.Do(req)
	if err != nil {
		panic(err)
	}
	defer resp.Body.Close()

	data, err := io.ReadAll(resp.Body)
	if err != nil {
		panic(err)
	}
	fmt.Println(resp.Status, string(data))
}
```

```ruby
require "json"
require "net/http"

uri = URI("https://domscan.net/v1/dns/history?domain=example.com&type=A&from=2026-01-01&to=2026-04-15&limit=10")
request = Net::HTTP::Get.new(uri)
request["X-API-Key"] = ENV.fetch("DOMSCAN_API_KEY")

response = Net::HTTP.start(uri.hostname, uri.port, use_ssl: true) do |http|
  http.request(request)
end
puts JSON.pretty_generate(JSON.parse(response.body))
```

#### Exemplo de resposta

```json
{
  "domain": "example.com",
  "history": [
    {
      "date": "2026-04-13",
      "record_type": "A",
      "changes": [
        {
          "action": "added",
          "value": "104.20.23.154"
        },
        {
          "action": "added",
          "value": "172.66.147.243"
        },
        {
          "action": "removed",
          "value": "104.18.26.120"
        }
      ]
    }
  ],
  "current_records": {
    "A": [
      "104.20.23.154",
      "172.66.147.243"
    ]
  },
  "first_seen": "2026-01-01",
  "last_seen": "2026-04-13",
  "total_changes": 3,
  "record_types_tracked": [
    "A"
  ],
  "beta_notice": "Beta observation log. Coverage comes only from successful DomScan DNS lookups. Dates are day-level, changes between lookups can be missed, and no external passive DNS sources are included.",
  "meta": {
    "note": "Lookup-driven DomScan observations only. Dates are day-level, gaps can miss changes, and no external passive DNS sources are included.",
    "data_source": "internal",
    "history_limit": 100,
    "history_rows_evaluated": 3,
    "history_rows_truncated": false,
    "removal_confirmation_days": 2,
    "current_records_scope": "all_stored_current_records"
  }
}
```

#### Códigos de status HTTP

- `200` OK
- `400` Pedido inválido
- `401` Não autorizado
- `402` Pagamento necessário
- `429` Demasiados pedidos

## Recursos de referência

[OpenAPI 3.0](https://domscan.net/v1/openapi.json)
[Postman](https://domscan.net/v1/postman.json)
[MCP](https://domscan.net/pt/mcp-domain-checker)
