# DNS Change Monitor: Record Changes Between Runs (`ucchiii/dns-change-monitor`) Actor

Get alerted when the DNS of your domains changes. Each run reads A, AAAA, CNAME, MX, NS, TXT and DMARC, compares them with the previous run and lists the changed records (type, before, after). NS, MX, SPF and DMARC changes are marked important. Up to 500 domains per run. Empty input = free demo.

- **URL**: https://apify.com/ucchiii/dns-change-monitor.md
- **Developed by:** [Actor Factory](https://apify.com/ucchiii) (community)
- **Categories:** Developer tools, SEO tools, Automation
- **Features:** Limited permissions
- **Stats:** 2 total users, 1 monthly users, 55.6% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $0.56 / 1,000 domain checks

This Actor is paid per event. You are not charged for the Apify platform usage, but only a fixed price for specific events.
Since this Actor supports Apify Store discounts, the price gets lower the higher subscription plan you have.

Learn more: https://docs.apify.com/actors/running/actors-in-store.md#pay-per-event

## What's an Apify Actor?

An Actor is a serverless cloud program that runs on the Apify platform. It has two run modes.
In Batch mode, an Actor accepts a well-defined JSON input, performs an action which can take anything from a few seconds to a few hours,
and optionally produces a well-defined JSON output, datasets with results, or files in key-value store.
In Standby mode, an Actor provides a web server which can be used as a website, API, or an MCP server.

Apify vocabulary and the platform model are defined once, in the agent quickstart at https://apify.com/agents.md.

## How to integrate an Actor?

If asked about integration, you help developers integrate Actors into their projects.
You adapt to their stack and deliver integrations that are safe, well-documented, and production-ready.

Do not guess an integration path. Every one of them is in the agent quickstart at https://apify.com/agents.md: the Apify MCP server, Agent Skills with the Apify CLI, the JavaScript and Python clients, the REST API, and the account-free path for an agent with no human to sign in. It also carries the rule on stating cost before the first paid run.

For examples already wired to this Actor's own input schema, see the [API](#api) section below.

Each client library has reference documentation the quickstart does not restate: [JavaScript/TypeScript](https://docs.apify.com/api/client/js/docs.md) (`npm install apify-client`) and [Python](https://docs.apify.com/api/client/python/docs.md) (`pip install apify-client`).

# README

**DNS change monitor: find out when the nameservers, mail servers or other DNS records of your domains change — without checking them by hand. Schedule it, and each run lists only the records that differ from the run before.**

A nameserver moved to another provider, an MX record pointed at a new mail host, an SPF or DMARC record edited, an A record that no longer matches your server: you usually learn about it when mail bounces or a site breaks. This Actor reads the DNS of your domains on every run, compares it with the answer it saved last time, and returns one row for each record that changed.

| domain | recordType | kind | before | after | important |
|---|---|---|---|---|---|
| example.com | NS | removed | ns1.old-host.example | null | true |
| example.com | NS | added | null | ns1.new-host.example | true |
| example.com | A | changed | 192.0.2.10 | 192.0.2.99 | false |

*(illustrative rows, not a real run: the rows of a real run carry the same fields, plus `detectedAt` and `previousCheckedAt`)*

**For anyone who has to notice DNS changes:** agencies and IT teams looking after client domains, owners of brand and defensive domains, mail admins who want to know when MX, SPF or DMARC is edited, and anyone who wants a nameserver change alert on a schedule.

**Try it:** clear the domain list and press **Start** for a free demo (rows carry `_demo: true`, not charged, nothing saved). The demo compares today's DNS of `example.com` with a made-up earlier answer, only so that you can see what the change rows look like. To monitor your own domains, enter them and press Start: the first run saves a **baseline** and reports no changes; from the second run on, changes are listed.

### How it works

1. **First run** for a domain: the records found are saved in a named key-value store in your account (**State store name**, default `dns-change-monitor-state`). The domain row says `baseline: true`; there are no change rows.
2. **Every later run**: the records are read again and compared with the saved ones. The domain row gives the number of changes; every changed record gets its own row. The new answer then replaces the saved one, so you hear about each change once.
3. Put the Actor on a **schedule** (Apify Schedules, hourly to weekly) and keep the same state store name. Use another name for another list of domains.

### What is compared

Public DNS only, read over DNS-over-HTTPS (Cloudflare 1.1.1.1). Nothing is sent to the domains.

| Record type | What is read | `important` |
|---|---|---|
| **NS** | name servers of the domain | yes |
| **MX** | mail servers (priority and host) | yes |
| **SPF** | the TXT record that starts with `v=spf1` | yes |
| **DMARC** | the TXT record at `_dmarc.<domain>` | yes |
| **A**, **AAAA** | IPv4 and IPv6 addresses of the domain itself | no |
| **CNAME** | alias of the domain itself | no |
| **TXT** | all other TXT records (verification tokens and the like) | no |

`kind` is `added`, `removed` or `changed`. `changed` (before and after on one row) is used when one record replaced another for A, AAAA, CNAME, SPF and DMARC. For NS, MX and TXT, which are sets of independent records, a replaced record is two rows: one `removed` and one `added`. A domain that stops existing shows all its records as `removed`; when it comes back, they show up as `added`.

### Status of a domain row

- `checked` — every DNS question was answered and the snapshot saved (charged). `baseline` tells whether it was the first run for this domain.
- `error` — a DNS lookup failed after the retries (the row says which). Nothing is saved, so the saved snapshot stays as it was and the next run compares with it. Free.
- `nxdomain` — the domain does not exist and was never saved before. Free.
- `invalid_input` — the entry is not a domain. Free.

### How to use

1. **Domains**: one per line (up to 500; URLs are accepted and reduced to the host name). Enter domains, not e-mail addresses.
2. **State store name**: keep the default, or choose a name per customer or list. Lower-case letters, digits and hyphens.
3. Press **Start**, or create a **Schedule** for it. Filter the table by `rowType` and `important`, export as CSV, JSON or Excel, or call it from the API; the run can also be connected to an alert (e-mail, Slack, webhook) on the change rows.

```json
{ "domains": ["python.org", "github.com", "example.com"], "stateStoreName": "dns-change-monitor-state" }
```

### Output

Two kinds of rows share the dataset (`rowType`):

```json
{
 "rowType": "domain",
 "domain": "example.com",
 "status": "checked",
 "baseline": false,
 "changes": 3,
 "importantChanges": 2,
 "previousCheckedAt": "2026-11-13T06:00:12Z",
 "checkedAt": "2026-11-14T06:00:09Z",
 "records": { "A": ["192.0.2.99"], "AAAA": [], "CNAME": [], "MX": ["10 mx.mail.example.net"], "NS": ["ns1.new-host.example"], "TXT": [], "DMARC": [] },
 "error": null
}
```

```json
{
 "rowType": "change",
 "domain": "example.com",
 "recordType": "NS",
 "kind": "added",
 "before": null,
 "after": "ns1.new-host.example",
 "important": true,
 "detectedAt": "2026-11-14T06:00:09Z",
 "previousCheckedAt": "2026-11-13T06:00:12Z"
}
```

*(illustrative values)*

- **SUMMARY** record: domains checked, new baselines, changes found, important changes, failed, not found, invalid input, charged domains and changes, and the number of DNS questions sent.

### Notes and limits

- **A change is a difference between two answers**, not a verdict. It can be a planned edit, a provider's rotation or a takeover; the Actor does not tell which. A name server that answers differently by location or time (for example DNS-based load balancing) can show as a change.
- Only the domain itself and `_dmarc.<domain>` are read. Subdomains are separate entries: enter `www.example.com` or `mail.example.com` to watch them. DKIM selectors, SRV, CAA and SOA are not read.
- Answers come from Cloudflare's public resolver, which may serve a cached answer for up to the record's TTL. A very recent change can show up one run later.
- The saved snapshot holds record values only (up to 100 per type), one entry per domain, in the key-value store you name. Delete the store (or use a new name) to start from a baseline again.
- Up to 500 domains per run (7 DNS questions each). Polite by design: at most 10 requests to the resolver at a time, at least 0.02 s apart, retries with back-off, a timeout on every request.
- If the run hits your spending limit, it stops before saving the current domain's snapshot, so its changes are reported again next time.
- Only public DNS data is read. TXT and DMARC records are returned as the domain owner published them.

### Pricing

| Event | Free plan | Paid plans (Store discount tiers Bronze / Silver / Gold) |
|---|---|---|
| Domain check (all lookups answered, snapshot saved) | $0.80 per 1,000 | $0.72 / $0.64 / $0.56 per 1,000 |
| Record change (each added, removed or changed record) | $4.00 per 1,000 | $3.60 / $3.20 / $2.80 per 1,000 |

The price on this page ("from ...") is the Gold tier price. A baseline run is charged per domain only (no changes yet). Lookup failures, domains that do not exist, invalid input and the free demo are **not charged**. Example: a daily schedule on 100 domains costs about $0.08 a day when nothing changes (100 domain checks).

### FAQ

**The first run shows no changes.** That is by design: nothing has been saved to compare with. It records the baseline; changes appear from the second run.

**Can two schedules share one state store?** Yes, if they watch different domains. If they watch the same domain, each run compares with the other's snapshot, so use one store name per list.

**Does it alert me?** The Actor returns the rows. To be alerted, use an Apify integration (e-mail, Slack, webhook) on the run, or filter on `rowType = change` and `important = true` in the dataset.

**Does it check e-mail addresses?** No. It reads the DNS records of domains only, and refuses entries with `@`.

If this Actor saved you time, a rating on the Store helps others find it.

### More tools from the same developer

- [DNS Lookup](https://apify.com/ucchiii/dns-records-lookup) — bulk DNS lookup: A, AAAA, MX, NS, TXT, SPF and DMARC per domain
- [Email DNS Checker](https://apify.com/ucchiii/email-dns-checker) — MX, SPF (with the 10-lookup count), DMARC and DKIM for many domains, with pass or needs attention and the reasons
- [Domain Expiry Checker](https://apify.com/ucchiii/domain-expiry-checker) — expiry dates of your own and your clients' domains in bulk, soonest first, with an N-days filter
- [SSL Certificate Expiry Checker](https://apify.com/ucchiii/ssl-certificate-checker) — SSL/TLS certificate expiry dates, issuer and validity for many hosts, soonest first
- [Domain Lock Checker](https://apify.com/ucchiii/domain-lock-checker) — transfer, delete and update locks, DNSSEC, CAA and expiry of your own domains, with a 0-100 score and an action-needed list

# Actor input Schema

## `domains` (type: `array`):

Domains like 'example.com' or 'mail.example.com' (URLs are accepted; only the host name is used). E-mail addresses are not accepted: enter the part after @. Up to 500 per run (extra ones are skipped); duplicates are removed. Entries that are not domains get an invalid_input row (free). Leave empty for a free demo (not charged, nothing saved).

## `stateStoreName` (type: `string`):

Name of the key-value store in your account where each run saves the records it found, so the next run can compare. Lower-case letters, digits and hyphens, up to 63 characters. Keep the same name for scheduled runs of the same domains. A new name starts again from a baseline. Default: dns-change-monitor-state.

## `timeoutSecs` (type: `integer`):

Timeout for each DNS request, in seconds. Failed requests are retried up to 3 times with a growing pause. Allowed range 1 to 60 (default 10).

## `concurrency` (type: `integer`):

How many domains are checked in parallel. Allowed range 1 to 10 (default 5). At most 10 requests go to the resolver at a time, with at least 0.02 s between them.

## Actor input object example

```json
{
  "domains": [
    "python.org",
    "github.com",
    "example.com"
  ],
  "stateStoreName": "dns-change-monitor-state",
  "timeoutSecs": 10,
  "concurrency": 5
}
```

# Actor output Schema

## `results` (type: `string`):

One row per domain checked (status, baseline, number of changes, current records) and one row per changed record (type, before, after, important).

## `summary` (type: `string`):

Record SUMMARY: domains checked, new baselines, changes found, important changes, failed, not found, invalid input, charged domains and changes, and DNS questions sent.

# API

You can run this Actor programmatically using our API. Below are code examples in JavaScript, Python, and CLI, as well as the OpenAPI specification and MCP server setup.

## JavaScript example

```javascript
import { ApifyClient } from 'apify-client';

// Initialize the ApifyClient with your Apify API token
// Replace the '<YOUR_API_TOKEN>' with your token
const client = new ApifyClient({
    token: '<YOUR_API_TOKEN>',
});

// Prepare Actor input
const input = {
    "domains": [
        "python.org",
        "github.com",
        "example.com"
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("ucchiii/dns-change-monitor").call(input);

// Fetch and print Actor results from the run's dataset (if any)
console.log('Results from dataset');
console.log(`💾 Check your data here: https://console.apify.com/storage/datasets/${run.defaultDatasetId}`);
const { items } = await client.dataset(run.defaultDatasetId).listItems();
items.forEach((item) => {
    console.dir(item);
});

// 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/js/docs

```

## Python example

```python
from apify_client import ApifyClient

# Initialize the ApifyClient with your Apify API token
# Replace '<YOUR_API_TOKEN>' with your token.
client = ApifyClient("<YOUR_API_TOKEN>")

# Prepare the Actor input
run_input = { "domains": [
        "python.org",
        "github.com",
        "example.com",
    ] }

# Run the Actor and wait for it to finish
run = client.actor("ucchiii/dns-change-monitor").call(run_input=run_input)

# Fetch and print Actor results from the run's dataset (if there are any)
print(f"💾 Check your data here: https://console.apify.com/storage/datasets/{run.default_dataset_id}")
for item in client.dataset(run.default_dataset_id).iterate_items():
    print(item)

# 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/python/docs/quick-start

```

## CLI example

```bash
echo '{
  "domains": [
    "python.org",
    "github.com",
    "example.com"
  ]
}' |
apify call ucchiii/dns-change-monitor --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,ucchiii/dns-change-monitor"
        }
    }
}
```

The hosted server signs you in with OAuth on first connect, so no API token belongs in this config. Clients without OAuth support can send an `Authorization: Bearer <APIFY_API_TOKEN>` header instead, using a token from API & Integrations in Apify Console (https://console.apify.com/settings/integrations).

## OpenAPI specification

Download the OpenAPI definition: https://api.apify.com/v2/actors/tnEk3Pggn4lfZ6MH7/builds/XytpMPJBRk5GfslIt/openapi.json
