Metadata-Version: 2.4
Name: dns-archiver
Version: 0.3.0
Summary: A CLI tool to dump DNS records into an archive
Author-email: Adam McKay <adam@beepboop.digital>
Requires-Python: >=3.10
Requires-Dist: dnspython>=2.6.1
Requires-Dist: rich>=13.6.0
Requires-Dist: typer>=0.9.0
Provides-Extra: dev
Requires-Dist: pytest>=8.0.0; extra == 'dev'
Requires-Dist: ruff>=0.2.0; extra == 'dev'
Description-Content-Type: text/markdown

# DNS Archiver

A Simple DNS lookup tool that dumps all records for archiving.

Useful to run on a schedule to monitor DNS changes which can help if a customer modifies their DNS and breaks their site you can quickly debug and tell what the old (correct) records were.

## Install

The recommended way to run is with `uvx` (part of [uv](https://docs.astral.sh/uv/)):

```bash
# Run directly without installing (recommended)
uvx dns-archiver example.com

# Or install persistently
uv tool install dns-archiver

# Alternative: use pipx
pipx install dns-archiver
```

## Usage

```
% dns-archiver --help

Usage: dns-archiver [OPTIONS] NAME

╭─ Arguments ──────────────────────────────────────────────────────────────────────────────────────────────────────────╮
│ *    name      TEXT  DNS name to lookup [required]                                                                   │
╰──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯
╭─ Options ────────────────────────────────────────────────────────────────────────────────────────────────────────────╮
│ --record                              [all|a|aaaa|cname|txt|ns|mx|soa]  The DNS record to archive [default: ALL]     │
│ --ttl                     --no-ttl                                      Include TTL values or not [default: ttl]     │
│ --nameserver          -n              TEXT                              DNS nameserver(s) to query (can be specified │
│                                                                         multiple times)                              │
│ --version             -v                                                                                             │
│ --install-completion                                                    Install completion for the current shell.    │
│ --show-completion                                                       Show completion for the current shell, to    │
│                                                                         copy it or customize the installation.       │
│ --help                                                                  Show this message and exit.                  │
╰──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯
```

## Examples

### Basic Usage

```bash
# Archive all DNS records for a domain
dns-archiver example.com

# Archive only A records
dns-archiver example.com --record A

# Archive without TTL values
dns-archiver example.com --no-ttl
```

### Using Custom Nameservers

```bash
# Query using Google's DNS
dns-archiver example.com -n 8.8.8.8

# Query using Cloudflare's DNS
dns-archiver example.com -n 1.1.1.1

# Query with multiple nameservers (uses first available)
dns-archiver example.com -n 8.8.8.8 -n 1.1.1.1

# Check DNS propagation across different providers
dns-archiver example.com -n 8.8.8.8 > google-dns.json
dns-archiver example.com -n 1.1.1.1 > cloudflare-dns.json
diff google-dns.json cloudflare-dns.json
```

### Monitoring and Archiving

```bash
# Save DNS snapshot to a file with timestamp
dns-archiver example.com > "dns-$(date +%Y%m%d-%H%M%S).json"

# Query specific record types for monitoring
dns-archiver example.com --record MX -n 8.8.8.8
```
