# Google Public DNS API

> Google Public DNS returns domain DNS records and email settings as a workflow and API.

Google Public DNS, also called Google DNS, returns DNS records for a domain, including record names, values, types, priorities, and cache times. Get dns records accepts a domain or website link and an optional record type; it also summarizes SPF, DMARC policy, and mail server setup.

- Page: https://fous.com/tools/google-public-dns
- Handle: `@google-public-dns`
- Category: [Developer tools](https://fous.com/tools/category/developer-tools)
- Source website: https://dns.google
- Last verified: Sep 29, 2026

## Methods

### Get dns records

Operation `get_dns_records`, version 1. 1 credit per completed call. Failed calls without a completed billing receipt are free; completed work can remain charged if delivery is interrupted.

Get DNS records for a domain and summarize its SPF, DMARC policy, and mail servers. Returns the requested record type or all supported types; a missing record type yields an empty records list.

**Input**

| Field | Type | Required | Example | Description |
|---|---|---|---|---|
| `domain` | string | yes | `"google.com"` | Domain name or pasted website link, for example example.com or https://example.com/about. |
| `record_type` | string | no | `"MX"` | Which DNS records to return, for example MX. Defaults to all. |

**Input schema**

```json
{
  "type": "object",
  "required": [
    "domain"
  ],
  "properties": {
    "domain": {
      "type": "string",
      "description": "Domain name or pasted website link, for example example.com or https://example.com/about.",
      "examples": [
        "google.com",
        "example.com",
        "https://example.com/about"
      ]
    },
    "record_type": {
      "enum": [
        "all",
        "A",
        "AAAA",
        "MX",
        "TXT",
        "NS",
        "CNAME",
        "SOA",
        "CAA"
      ],
      "type": "string",
      "default": "all",
      "description": "Which DNS records to return, for example MX. Defaults to all.",
      "examples": [
        "MX",
        "TXT"
      ]
    }
  },
  "additionalProperties": false,
  "examples": [
    {
      "domain": "google.com",
      "record_type": "MX"
    },
    {
      "domain": "example.com"
    },
    {
      "domain": "https://example.com/about",
      "record_type": "TXT"
    }
  ]
}
```

**Output**

| Field | Type | Example | Description |
|---|---|---|---|
| `records` | array |  | DNS records matching the chosen record type. |
| `records[].name` | string | `"google.com"` | Name owning the record. |
| `records[].value` | string | `"smtp.google.com."` | DNS record value. |
| `records[].priority` | integer or null | `10` | MX priority; null for other record types. |
| `records[].page_link` | string | `"https://dns.google/resolve?name=google.com&type=MX"` | Public DNS lookup for this record name and type. |
| `records[].record_type` | string | `"MX"` | DNS record type. |
| `records[].time_to_live_seconds` | integer | `30` | Time this answer may be cached, in seconds. |
| `email_setup` | object |  |  |
| `email_setup.spf_record` | string or null | `"v=spf1 include:_spf.google.com ~all"` | SPF record text, or null if missing. |
| `email_setup.dmarc_policy` | string | `"reject"` | DMARC policy in words or missing. |
| `email_setup.has_mail_servers` | boolean | `true` | Whether usable MX mail servers are configured. |

**Example input**

```json
{
  "domain": "google.com",
  "record_type": "MX"
}
```

**Example output**

```json
{
  "records": [
    {
      "name": "google.com",
      "value": "smtp.google.com.",
      "priority": 10,
      "page_link": "https://dns.google/resolve?name=google.com&type=MX",
      "record_type": "MX",
      "time_to_live_seconds": 30
    }
  ],
  "email_setup": {
    "spf_record": "v=spf1 include:_spf.google.com ~all",
    "dmarc_policy": "reject",
    "has_mail_servers": true
  }
}
```

## Quick start

Replace `YOUR_API_KEY` with a Fous API key. To create one, open Developers at the bottom of Fous Studio, turn on Developer mode, then go to API keys (https://app.fous.com/keys). Change the values in `input` to run the same tool on new data.

```bash
curl 'https://api.fous.com/v1/query' \
  --fail-with-body --silent --show-error --max-time 180 \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H 'Content-Type: application/json' \
  --data-raw '{
  "api": "@google-public-dns",
  "visibility": "public",
  "operation": "get_dns_records",
  "version": 1,
  "input": {
    "domain": "google.com",
    "record_type": "MX"
  },
  "response": {
    "format": "json"
  }
}'
```

```python
# Save as fous.py and run with python3 fous.py. No packages needed.
import json
import urllib.error
import urllib.request

api_key = "YOUR_API_KEY"

body = json.loads("{\n  \"api\": \"@google-public-dns\",\n  \"visibility\": \"public\",\n  \"operation\": \"get_dns_records\",\n  \"version\": 1,\n  \"input\": {\n    \"domain\": \"google.com\",\n    \"record_type\": \"MX\"\n  },\n  \"response\": {\n    \"format\": \"json\"\n  }\n}")
request = urllib.request.Request(
    "https://api.fous.com/v1/query",
    data=json.dumps(body).encode("utf-8"),
    headers={
        "Authorization": f"Bearer {api_key}",
        "Content-Type": "application/json",
    },
    method="POST",
)
try:
    with urllib.request.urlopen(request, timeout=180) as response:
        result = json.load(response)
except urllib.error.HTTPError as error:
    raise RuntimeError(f"HTTP {error.code}: {error.read().decode('utf-8', errors='replace')}") from error
if result.get("success") is False:
    raise RuntimeError(result.get("error", {}).get("message", "Request failed"))
print(json.dumps(result["data"]["output"], indent=2))
```

```typescript
// Save as fous.mts and run with npx tsx fous.mts.
const apiKey = "YOUR_API_KEY";

const response = await fetch("https://api.fous.com/v1/query", {
  method: "POST",
  headers: {
    "Authorization": `Bearer ${apiKey}`,
    "Content-Type": "application/json",
  },
  signal: AbortSignal.timeout(180_000),
  body: JSON.stringify({
  "api": "@google-public-dns",
  "visibility": "public",
  "operation": "get_dns_records",
  "version": 1,
  "input": {
    "domain": "google.com",
    "record_type": "MX"
  },
  "response": {
    "format": "json"
  }
}),
});
type ApiResult = { success: boolean; data?: { output: unknown }; error?: { message: string } };
const result: ApiResult = await response.json();
if (!response.ok || result.success === false) {
  throw new Error(result.error?.message ?? `HTTP ${response.status}`);
}
if (!result.data) throw new Error("Missing API response data");
console.log(result.data.output);
```

## Use from an AI assistant

Connect this tool to Claude Code, Claude Desktop, Cursor, VS Code, Codex and any MCP client as its own MCP server. Each method is a typed tool whose arguments are the method’s input.

- Server URL: `https://api.fous.com/mcp/tools/google-public-dns`
- Authorization: `Authorization: Bearer <Fous API key>`

**Tools**

- `get_dns_records`: Get dns records. 1 credit per completed call. Failed calls without a completed billing receipt are free; completed work can remain charged if delivery is interrupted.
- `fous_get_run`: the result of a run that was still going, by its `request_id`. Free.

Claude Code:

```bash
claude mcp add --scope user --transport http fous-google-public-dns https://api.fous.com/mcp/tools/google-public-dns --header "Authorization: Bearer ${FOUS_API_KEY:?Set FOUS_API_KEY to your Fous API key}"
```

To give the assistant every tool, connect `https://api.fous.com/mcp`: it finds one with `fous_search_tools` and runs it with `fous_run_tool`. Setup for other clients: https://fous.com/llms-full.txt.

## Use cases

- Check which mail servers a domain uses
- Review a domain’s SPF and DMARC settings
- Inspect DNS record values and cache times
- Find records of a specific type for a domain

## FAQ

### Can I run it with my own inputs?

Yes. Change the inputs in Studio and press Run, or send new inputs from your code, or ask a connected AI assistant.

### Can I call this Google Public DNS tool as an API?

Yes. Send a POST request to /v1/query with your Fous API key and the inputs, and get JSON back.

### How much does it cost?

Each completed run costs 1 credit. Failed runs without a completed receipt are free; completed work can remain charged if delivery is interrupted. With pay as you go, a credit costs 1¢. Monthly plans cost less per credit.

### Do I need a Google Public DNS account?

No. You only need a Fous account.

### How current is the data?

Fous gets the data from dns.google when you run it. Some results are reused for up to 24 hours, and results that use your account or key are never reused. It was last verified on Sep 29, 2026.

### Which mail servers are configured for a domain?

Use Get dns records to retrieve MX records and check whether usable mail servers are configured.

### What SPF and DMARC settings does a domain have?

Get dns records summarizes the SPF record text and DMARC policy, noting when either is missing.

### What DNS records does a domain have?

Use Get dns records with a domain; choose a record type or leave it unspecified to request all supported types.

## Related

- [ICANN Lookup API](https://fous.com/tools/icann-lookup.md): Public domain registration lookup using ICANN registration data.
- [Google Search API](https://fous.com/tools/google-search.md): Google Search returns public web, image, job, event, related-question, and autocomplete results in Google’s order, with answers and details when available; results may be fewer, omit information, or be empty.
- [Google Maps API](https://fous.com/tools/google-maps.md): Google Maps returns nearby places, public place details, up to 100 public reviews, and up to three routes; transit options vary by departure time.
- [DuckDuckGo API](https://fous.com/tools/duckduckgo.md): Private web search and instant answers.
- [Cloudflare Radar API](https://fous.com/tools/cloudflare-radar.md): Cloudflare Radar provides internet trends, domain popularity and weekly rank history only for top-100 sites, plus recent and ongoing outages with locations when identified.
- [Google Patents API](https://fous.com/tools/google-patents.md): Google Patents searches public records and provides patent details and company summaries; legal status is estimated, and citations, claims, and company breakdowns have record limits.
- [Google Books API](https://fous.com/tools/google-books.md): Google Books searches books and provides book details, reader ratings, and local ebook prices when available; newest results sort by publication date.
- [Google Play API](https://fous.com/tools/google-play.md): Google Play helps people discover Android apps and games, view public listings and search results, read reviews when available by app and region, and see country-specific top charts.
- [All Developer tools tools](https://fous.com/tools/category/developer-tools)
