Zone transfer and dns

Zone transfer and dns-express
Jing Lin
2011.9.19
V1.0
2
Version
Date
Author
1.0
2011.9.19
Jing Lin
Note
© F5 Networks, Inc.
3
Zone transfer
• Slave name server pull zone files from master name server
• There are two types of zone transfer, AXFR and IXFR
• AXFR means full zones transfer
• IXFR means incremental transfer
© F5 Networks, Inc.
4
Zone transfer
• An initial slave name server starts up, it will request AXFR to
master server.
• After the first transfer finished, slave server will check if there
is update on master server by send IXFR, the checking
interval is according the refresh value of SOA. It will change
to AXFR if the master does not support IXFR.
• The default bind behavior supports AXFR and IXFR.
© F5 Networks, Inc.
5
notify
• To make slave server knows update from master asap,
master server will send out notify to all slave servers, default,
master will only send notify message to all slave servers that
are defined in zone file.
• “Also-notify {ip port}” statement will let master server aslo
send notify to those servers in addition to slave server
which in zone.
• If slave server get a notify, it will send a soa query to master
server, and compare serial number to himself, if the master
server’s serial number greater than self, slave server will
starts IXFR, if IXFR is failed, will use AXFR.
© F5 Networks, Inc.
6
Master
• Master server:
• zone "cnadn.net" {
•
type master;
•
allow-transfer {192.168.209.72;192.168.209.188;};
•
//file "/etc/bind/db.cnadn.net.signed";
•
file "/etc/bind/db.cnadn.net";
• };
• BIND default allow all host to run AXFR to him, need be
careful on this.
© F5 Networks, Inc.
7
slave
• zone "cnadn.net" {
•
type slave;
•
masters {192.168.209.71;};
•
//file "/etc/bind/db.cnadn.net.signed";
•
file "slave.db.cnadn.net";
• };
© F5 Networks, Inc.
8
DNS Express
© F5 Networks, Inc.
9
GTM DNS express
• Pull dns into memory. Respond answer from RAM directly,
this will improve performance significantly.
• It is a LTM function, not only for GTM module.
• Support all kinds of RR type but AXFR and IXFR, which
means you cant run AXFR/IXFR to dns express
• Support TSIG, and support to be notified.
• DO NOT support view.
• Support ipv6 and tcp/udp/
• Support dnssec??? (Should be, will verify it in another ppt)
© F5 Networks, Inc.
10
How dns express works
• It lives in TMM actually
• Zxfrd which a new process in v11 control zxfrd.bin file.
• TMM reads a binary db file from /var/db/tmmdns.bin
• When update happens, zxrfd.bin will be updated first, then
some times later tmmdns.bin will be wrote by zxfrd.
• At last these 2 files should be same
© F5 Networks, Inc.
11
How dns express works
© F5 Networks, Inc.
12
Zxfrd state transitions
© F5 Networks, Inc.
13
Dns request match rule
• When bigip receives a dns request:
• 1. If it matches a wideip (gtm module), if yes, follow wideip
configuration to answer the request. If no, go to step 2
• 2.Check if matches dns express zone, if yes, tmm respond
answer from dns express zone directly. If no, go to step 3.
• 3. Check the listener vs, decide if the request need to be
sent to backend dns server (pool member)
© F5 Networks, Inc.
14
DNS express troubleshooting
• Check /var/log/ltm, grep logs of zxfrd
• Check zxfrd process status with bigstart status zxfrd
• Zxfrd listen on ::1:5353
• Zone transfer uses tcp:53
© F5 Networks, Inc.
15
Sample logs
•
When master refuse bigip’s axfr/ixfr:
•
Sep 18 10:46:31 ltm6900-1 err zxfrd[6393]: 01531010:3: Transfer of zone cnadn.net failed b/c there are no
records.
•
Sep 18 10:46:31 ltm6900-1 err zxfrd[6393]: 01531015:3: Failed to retrieve next RR in XFR for zone cnadn.net.
•
Sep 18 10:46:31 ltm6900-1 err zxfrd[6393]: 01531018:3: Failed to transfer zone cnadn.net from 192.168.209.71,
will attempt AXFR.
•
Sep 18 10:46:31 ltm6900-1 notice zxfrd[6393]: 01531023:5: Scheduling zone transfer in 5s for cnadn.net from
192.168.209.71.
•
Sep 18 10:46:36 ltm6900-1 err zxfrd[6393]: 01531010:3: Transfer of zone cnadn.net failed b/c there are no
records.
•
Sep 18 10:46:36 ltm6900-1 err zxfrd[6393]: 01531015:3: Failed to retrieve next RR in XFR for zone cnadn.net.
•
Sep 18 10:46:36 ltm6900-1 err zxfrd[6393]: 01531018:3: Failed to transfer zone cnadn.net from 192.168.209.71,
will attempt AXFR.
•
Sep 18 10:46:36 ltm6900-1 notice zxfrd[6393]: 01531023:5: Scheduling zone transfer in 5s for cnadn.net from
192.168.209.71.
© F5 Networks, Inc.
16
Sample logs-continue
• After the master allow bigip transfer:
• Sep 18 10:47:06 ltm6900-1 notice zxfrd[6393]: 0153101f:5: AXFR Transfer of
zone cnadn.net from 192.168.209.71 succeeded.
• Sep 18 10:47:06 ltm6900-1 notice zxfrd[6393]: 01531023:5: Scheduling zone
transfer in 180s for cnadn.net from 192.168.209.71.
• Regular checking with soa-refresh time interval:
• Sep 18 10:56:06 ltm6900-1 notice zxfrd[6393]: 01531025:5: Serials equal
(2011091901); transfer for zone cnadn.net complete.
• Sep 18 10:56:06 ltm6900-1 debug zxfrd[6393]: 01531008:7: Resetting transfer
state for zone cnadn.net.
• Sep 18 10:56:06 ltm6900-1 notice zxfrd[6393]: 01531023:5: Scheduling zone
transfer in 180s for cnadn.net from 192.168.209.71.
© F5 Networks, Inc.
17
Sample logs-continue
• When bigip finds the master’s serial number is greater:
• Sep 18 11:05:06 ltm6900-1 debug zxfrd[6393]: 01531206:7: Cleared
zone cnadn.net from db.
• Sep 18 11:05:06 ltm6900-1 notice zxfrd[6393]: 0153101f:5: AXFR
Transfer of zone cnadn.net from 192.168.209.71 succeeded.
• Sep 18 11:05:06 ltm6900-1 debug zxfrd[6393]: 01531203:7:
Scheduling DB dump with zone cnadn.net.
• Sep 18 11:05:06 ltm6900-1 debug zxfrd[6393]: 01531008:7: Resetting
transfer state for zone cnadn.net.
• Sep 18 11:05:06 ltm6900-1 notice zxfrd[6393]: 01531023:5:
Scheduling zone transfer in 180s for cnadn.net from 192.168.209.71.
© F5 Networks, Inc.
18
Sample logs-continue
•
When receive notify message:
•
Sep 18 11:21:23 ltm6900-1 notice zxfrd[6393]: 0153101c:5: Handling NOTIFY for zone cnadn.net.
•
Sep 18 11:21:23 ltm6900-1 debug zxfrd[6393]: 01531008:7: Resetting transfer state for zone cnadn.net.
•
Sep 18 11:21:23 ltm6900-1 notice zxfrd[6393]: 01531023:5: Scheduling zone transfer in 5s for cnadn.net from
192.168.209.71.
•
Sep 18 11:21:28 ltm6900-1 debug zxfrd[6393]: 01531206:7: Cleared zone cnadn.net from db.
•
Sep 18 11:21:28 ltm6900-1 notice zxfrd[6393]: 0153101f:5: AXFR Transfer of zone cnadn.net from
192.168.209.71 succeeded.
•
Sep 18 11:21:28 ltm6900-1 debug zxfrd[6393]: 01531203:7: Scheduling DB dump with zone cnadn.net.
•
Sep 18 11:21:28 ltm6900-1 debug zxfrd[6393]: 01531008:7: Resetting transfer state for zone cnadn.net.
•
Sep 18 11:21:28 ltm6900-1 notice zxfrd[6393]: 01531023:5: Scheduling zone transfer in 60s for cnadn.net from
192.168.209.71.
© F5 Networks, Inc.
19
Verify dns-express status
• Check statistics of the dns-express zone from GUI, set data
format as unformatted.
• Check dns-express zone color, it should be green.
• Tmsh show ltm dns dns-express
© F5 Networks, Inc.
20
Dump dns-express to a file
• Run below command, will show result on terminal.
• dnsxdump
© F5 Networks, Inc.
21
Debug zxfrd
• Trun on zxfrd debug
• tmsh modify sys db log.zxfrd.level value debug
• (defautl is notice)
• Output will be in /var/tmp/zxfrd.out
© F5 Networks, Inc.
22
How to config dns-express
• Create a dns profile and enable dns-express from LTM menu.
• Create a gtm listener or dns-vs and associate it with the dns
profile
• Create a dns-express zone:
• Target ip is the master server, if using TSIG, select a TSIG
KEY for the zone.
• Notify , keep as consume.
© F5 Networks, Inc.
© 2011 F5 Networks, Inc. All rights reserved. F5, F5 Networks, the F5 logo, BIG-IP, ARX, FirePass, iControl, iRules, TMOS,
and VIPRION are registered trademarks of F5 Networks, Inc. in the U.S. and in certain other countries