lesser known dns tools and bind tricks - …cas/bind-tricks-talk/lesser-known...8/4/12 lesser known...
TRANSCRIPT
8/4/12 Lesser known DNS tools and BIND tricks
1/56file:///home/cas/talk/bind-tricks/html/dns-tricks.html
Lesser known DNS tools andBIND tricksdnsworkshop.org
August 2012
8/4/12 Lesser known DNS tools and BIND tricks
2/56file:///home/cas/talk/bind-tricks/html/dns-tricks.html
About me
8/4/12 Lesser known DNS tools and BIND tricks
3/56file:///home/cas/talk/bind-tricks/html/dns-tricks.html
6502BasicForthAssembler
8/4/12 Lesser known DNS tools and BIND tricks
4/56file:///home/cas/talk/bind-tricks/html/dns-tricks.html
8086MSDOSPascalCAssembler
8/4/12 Lesser known DNS tools and BIND tricks
5/56file:///home/cas/talk/bind-tricks/html/dns-tricks.html
Power CPUAS/400CLRPGSNA
8/4/12 Lesser known DNS tools and BIND tricks
6/56file:///home/cas/talk/bind-tricks/html/dns-tricks.html
386OS/2RexxModulaOberonJavaNetBIOS
8/4/12 Lesser known DNS tools and BIND tricks
7/56file:///home/cas/talk/bind-tricks/html/dns-tricks.html
UnixSolarisLinuxOpenBSDFreeBSDTCP/IP
8/4/12 Lesser known DNS tools and BIND tricks
8/56file:///home/cas/talk/bind-tricks/html/dns-tricks.html
NetworkDNSDHCPIPv6DNSSEC
8/4/12 Lesser known DNS tools and BIND tricks
9/56file:///home/cas/talk/bind-tricks/html/dns-tricks.html
WorkMen & MiceISCLinuxHotel
8/4/12 Lesser known DNS tools and BIND tricks
10/56file:///home/cas/talk/bind-tricks/html/dns-tricks.html
DNS lookup
8/4/12 Lesser known DNS tools and BIND tricks
11/56file:///home/cas/talk/bind-tricks/html/dns-tricks.html
quick DNS lookupDNS lookup tool, easy to parse output
dnsget guug.de
or
dig guug.de +short
8/4/12 Lesser known DNS tools and BIND tricks
12/56file:///home/cas/talk/bind-tricks/html/dns-tricks.html
pretty print DNSpretty print dns results
dig soa dnsworkshop.org +multiline
8/4/12 Lesser known DNS tools and BIND tricks
13/56file:///home/cas/talk/bind-tricks/html/dns-tricks.html
checking SOA recordslookup SOA record from all authoritative DNS servers of a zone
dig dnsworkshop.org +nssearch
8/4/12 Lesser known DNS tools and BIND tricks
14/56file:///home/cas/talk/bind-tricks/html/dns-tricks.html
map DNS names in a zonebrute force map all DNS names in a zone
dnsmap guug.de
8/4/12 Lesser known DNS tools and BIND tricks
15/56file:///home/cas/talk/bind-tricks/html/dns-tricks.html
bulk resolve namesasynchronous DNS to resolve names (or IP addresses to names) in logfiles
cat queryfileexample1million | head | adnshost af
8/4/12 Lesser known DNS tools and BIND tricks
16/56file:///home/cas/talk/bind-tricks/html/dns-tricks.html
DNS resolve filterresolve IP addresses to names in a filter
lsof i n | adnsresfilter
8/4/12 Lesser known DNS tools and BIND tricks
17/56file:///home/cas/talk/bind-tricks/html/dns-tricks.html
browse multicast DNSBonjour / Rendezvous / Avahi DNS service discovery browser
avahibrowse
or
mdnsscan
8/4/12 Lesser known DNS tools and BIND tricks
18/56file:///home/cas/talk/bind-tricks/html/dns-tricks.html
mailserver for a domainquick find the mailserver for a domain
ldnsmx isc.org
8/4/12 Lesser known DNS tools and BIND tricks
19/56file:///home/cas/talk/bind-tricks/html/dns-tricks.html
a terse display of a zoneprint a parseable tree view of a DNS zone
dns_tree gnu.org
8/4/12 Lesser known DNS tools and BIND tricks
20/56file:///home/cas/talk/bind-tricks/html/dns-tricks.html
graphical DNS and DNSSEClookup tool
8/4/12 Lesser known DNS tools and BIND tricks
21/56file:///home/cas/talk/bind-tricks/html/dns-tricks.html
monitoring
8/4/12 Lesser known DNS tools and BIND tricks
22/56file:///home/cas/talk/bind-tricks/html/dns-tricks.html
find version of serverprint the version information reported by a DNS server
ldnschaos f.rootservers.net
8/4/12 Lesser known DNS tools and BIND tricks
23/56file:///home/cas/talk/bind-tricks/html/dns-tricks.html
fingerprint DNS serversfind server software and versions by fingerprinting DNS responses
fpdns Df google.com
8/4/12 Lesser known DNS tools and BIND tricks
24/56file:///home/cas/talk/bind-tricks/html/dns-tricks.html
measure DNS latencymeasure the DNS response time
echoping n 20 m dns 8.8.8.8 dnsworkshop.org
8/4/12 Lesser known DNS tools and BIND tricks
25/56file:///home/cas/talk/bind-tricks/html/dns-tricks.html
monitor DNS queriesmonitor all DNS queries seen by the local machine
sudo dnstop l 3 eth0
8/4/12 Lesser known DNS tools and BIND tricks
26/56file:///home/cas/talk/bind-tricks/html/dns-tricks.html
monitor or capture DNS queriesdnscap is a traffic capturing tool for DNS
sudo dnscap g
8/4/12 Lesser known DNS tools and BIND tricks
27/56file:///home/cas/talk/bind-tricks/html/dns-tricks.html
visualize DNS traffic flow# sudo tcpdump i eth0 w dnsdump.pcap port 53# dnspktflow dnsdump.pcap# eog out.png
8/4/12 Lesser known DNS tools and BIND tricks
28/56file:///home/cas/talk/bind-tricks/html/dns-tricks.html
troubleshooting
8/4/12 Lesser known DNS tools and BIND tricks
29/56file:///home/cas/talk/bind-tricks/html/dns-tricks.html
trace the delegation treedig dnsworkshop.org +trace
or
dnstracer s . www.dnsworkshop.org
8/4/12 Lesser known DNS tools and BIND tricks
30/56file:///home/cas/talk/bind-tricks/html/dns-tricks.html
check a domain for issuesdownload a zonefile and checks for issues
dnswalk gnu.org.
8/4/12 Lesser known DNS tools and BIND tricks
31/56file:///home/cas/talk/bind-tricks/html/dns-tricks.html
check your zone for errorsthe zonecheck tool (on the Internet or installed locally)
8/4/12 Lesser known DNS tools and BIND tricks
32/56file:///home/cas/talk/bind-tricks/html/dns-tricks.html
visualize a DNS zone# dig @ns2.gnu.org. axfr gnu.org +onesoa > gnu.orgzone# mapper gnu.orgzone gnu.org# eog map.png
8/4/12 Lesser known DNS tools and BIND tricks
33/56file:///home/cas/talk/bind-tricks/html/dns-tricks.html
DNSSEC
8/4/12 Lesser known DNS tools and BIND tricks
34/56file:///home/cas/talk/bind-tricks/html/dns-tricks.html
check resolver for DNSSECcompliance
8/4/12 Lesser known DNS tools and BIND tricks
35/56file:///home/cas/talk/bind-tricks/html/dns-tricks.html
SSH fingerprint resource recordsgenerate sshfp records from your knownhosts file
sshfp
8/4/12 Lesser known DNS tools and BIND tricks
36/56file:///home/cas/talk/bind-tricks/html/dns-tricks.html
Walk a NSEC signed zonetraverse all domain names in a zone that is NSEC signed
ldnswalk paypal.com
or
walker paypal.com
8/4/12 Lesser known DNS tools and BIND tricks
37/56file:///home/cas/talk/bind-tricks/html/dns-tricks.html
trace the 'chainoftrust'tracing the chain of trust to the root trust anchor
# drill dnskey . | grep 257 > root.key# drill SD k root.key www.ripe.net
8/4/12 Lesser known DNS tools and BIND tricks
38/56file:///home/cas/talk/bind-tricks/html/dns-tricks.html
peek into a validating resolverunboundhost lets you view every step of DNSSEC validation
unboundhost C /etc/unbound/unbound.conf dvv www.isc.org
8/4/12 Lesser known DNS tools and BIND tricks
39/56file:///home/cas/talk/bind-tricks/html/dns-tricks.html
sanity check a DNSSEC signedzone
check a DNSSEC signed zone for issues
donuts r "/usr/share/dnssectools/donuts/rules/*.txt" \ dnsworkshop.orgzonefile dnsworkshop.org
or
ldnsverify dnsworkshop.orgzonefile
8/4/12 Lesser known DNS tools and BIND tricks
40/56file:///home/cas/talk/bind-tricks/html/dns-tricks.html
BIND
8/4/12 Lesser known DNS tools and BIND tricks
41/56file:///home/cas/talk/bind-tricks/html/dns-tricks.html
statistics channel over httpacl myadmins 192.0.2.100; 192.0.2.101; ;
statisticschannels inet * port 8053 allow myadmins; ;;
8/4/12 Lesser known DNS tools and BIND tricks
42/56file:///home/cas/talk/bind-tricks/html/dns-tricks.html
check config + zonefiles beforereload
verify named.conf (and all zonefiles loaded) for syntax errors
namedcheckconf z
8/4/12 Lesser known DNS tools and BIND tricks
43/56file:///home/cas/talk/bind-tricks/html/dns-tricks.html
pretty print a configuration fileif you see a messedup BIND config, pretty print it
namedcheckconf p > named.conf
8/4/12 Lesser known DNS tools and BIND tricks
44/56file:///home/cas/talk/bind-tricks/html/dns-tricks.html
pretty print the canonical form ofa zone
some errors are hiding in shortcuts
namedcheckzone D problemdomain.com problemdomain.comzone
8/4/12 Lesser known DNS tools and BIND tricks
45/56file:///home/cas/talk/bind-tricks/html/dns-tricks.html
tune the concurrent client settingadjust recursive clients to real world value on a busy caching DNSserver
options [...] recursiveclients 2000; tcpclients 200;;
8/4/12 Lesser known DNS tools and BIND tricks
46/56file:///home/cas/talk/bind-tricks/html/dns-tricks.html
limit the size of the cachea BIND caching DNS server gets slower with a large cache (> 2GB)
options [...] maxcachesize 2147483648; // 2GB max cache;
8/4/12 Lesser known DNS tools and BIND tricks
47/56file:///home/cas/talk/bind-tricks/html/dns-tricks.html
compile zones to binary formatfor fast startup
compile a textversion of a zone to "raw" binary format
# namedcompilezone F raw o gnu.orgraw gnu.org gnu.orgzone zone gnu.org/IN: loaded serial 2011071556dump zone to gnu.orgraw...doneOK
and in named.conf
zone "example.com" type master; file "example.com.raw"; masterfileformat raw;;
8/4/12 Lesser known DNS tools and BIND tricks
48/56file:///home/cas/talk/bind-tricks/html/dns-tricks.html
convert from RAW zone formatto text format
BIND 9.9.x+ creates RAW files by default (for slave and stubzones)
namedcompilezone f raw o slave.example.orgtext \ slave.example.org slave.example.org
this command turns them into RFC 1035 text format
8/4/12 Lesser known DNS tools and BIND tricks
49/56file:///home/cas/talk/bind-tricks/html/dns-tricks.html
print the content of a journal fileBIND collects changes for dynamic zones in a binary journal file
namedjournalprint dynamic.signed.dnslab.org.jnl
8/4/12 Lesser known DNS tools and BIND tricks
50/56file:///home/cas/talk/bind-tricks/html/dns-tricks.html
simple dynamic zone setup(BIND 9.7.2+)
enable dynamic updates
zone "example.com" type master; file "example.comzone"; updatepolicy local;;
and use "nsupdate" to make changes to the zone (from the DNS servermachine)
# nsupdate l> update add www.example.com. 3600 IN A 192.0.2.80> update delete old.example.com. A> send
8/4/12 Lesser known DNS tools and BIND tricks
51/56file:///home/cas/talk/bind-tricks/html/dns-tricks.html
FUN
8/4/12 Lesser known DNS tools and BIND tricks
52/56file:///home/cas/talk/bind-tricks/html/dns-tricks.html
Bert's Secure Reverse PolishDNS Calculator (BSRPDNSC)
Try Bert's Secure Reverse Polish DNS Calculator (BSRPDNSC). Thisis nice because you don't need your HP48 or Forth to do serious RPNcalculations:
# dig "9.dup.*.rp.secretwg.org" TXT
8/4/12 Lesser known DNS tools and BIND tricks
53/56file:///home/cas/talk/bind-tricks/html/dns-tricks.html
Wikipedia over DNSno web browser to lookup things in Wikipedia? Use DNS
# dig txt guug.wp.dg.cx
8/4/12 Lesser known DNS tools and BIND tricks
54/56file:///home/cas/talk/bind-tricks/html/dns-tricks.html
Query the lastest twitter newsover DNS
who needs a twitter client?
dig guug.twitter.any.io txt +short
8/4/12 Lesser known DNS tools and BIND tricks
55/56file:///home/cas/talk/bind-tricks/html/dns-tricks.html
Thank you
Links to the tools and webpages mentionedin this talk can be found on dnsworkshop.org
8/4/12 Lesser known DNS tools and BIND tricks
56/56file:///home/cas/talk/bind-tricks/html/dns-tricks.html