summaryrefslogtreecommitdiff
path: root/0-dump-root-zone.sh
blob: b3d7cab3d3224bdd84e07280e06e267b9138b537 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
#!/bin/bash

set -e

# Empties the contents of the root dns file
0>work/db.root

# Prints a header for the root dns file
cat > work/db.root <<-EOF
\$TTL 2d ; Default TTL for zone
\$ORIGIN .

@   IN  SOA dumb.  pufferfish.mpgn.dev. (
    0   ; serial number
    12h ; refresh
    15m ; update retry
    3w  ; expiry
    2h  ; minimum
    )
EOF

# Adds the root dns zone's content
dig -t axfr . @iad.xfr.dns.icann.org \
    |grep -E 'DS|NS|A|AAAA' \
    |sed '/RRSIG/d' \
    |sed '/^\./d' >> work/db.root