250 likes | 493 Views
Zone transfer and dns -express. Jing Lin 2011.9.19 V1.0. 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. Zone transfer.
E N D
Zone transfer and dns-express Jing Lin 2011.9.19 V1.0
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
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.
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.
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.
slave • zone "cnadn.net" { • type slave; • masters {192.168.209.71;}; • //file "/etc/bind/db.cnadn.net.signed"; • file "slave.db.cnadn.net"; • };
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)
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
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)
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
Sample logs • When master refuse bigip’saxfr/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.
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.
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.
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.
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 ltmdnsdns-express
Dump dns-express to a file • Run below command, will show result on terminal. • dnsxdump
Debug zxfrd • Trun on zxfrd debug • tmsh modify sys dblog.zxfrd.level value debug • (defautl is notice) • Output will be in /var/tmp/zxfrd.out
How to configdns-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.