DNS zone transfers from FreeIPA to non-freeipa slave servers



Similar documents
DNS and LDAP persistent search

DNS Service on Linux. Supawit Wannapila CCNA, RHCE

Domain Name System Security

Creating a master/slave DNS server combination for your Grid Infrastructure

Domain Name System :49:44 UTC Citrix Systems, Inc. All rights reserved. Terms of Use Trademarks Privacy Statement

DNS ActiveX Control for Microsoft Windows. Copyright Magneto Software All rights reserved

DNS Conformance Test Specification For Client

DNS Session 4: Delegation and reverse DNS. Joe Abley AfNOG 2006 workshop

DNS and BIND. David White

How-to: DNS Enumeration

USING TRANSACTION SIGNATURES (TSIG) FOR SECURE DNS SERVER COMMUNICATION

Domain Name System (DNS) Fundamentals

Domain Name Server. Training Division National Informatics Centre New Delhi

Configuring DNS. Finding Feature Information

Securing an Internet Name Server

Table of Contents DNS. How to package DNS messages. Wire? DNS on the wire. Some advanced topics. Encoding of domain names.

Advanced DNS Course. Module 4. DNS Load Balancing

Local DNS Attack Lab. 1 Lab Overview. 2 Lab Environment. SEED Labs Local DNS Attack Lab 1

Managing DNS Server Properties

DNS. Some advanced topics. Karst Koymans. (with Niels Sijm) Informatics Institute University of Amsterdam. (version 2.6, 2013/09/19 10:55:30)

Module 2. Configuring and Troubleshooting DNS. Contents:

netkit lab dns Università degli Studi Roma Tre Dipartimento di Informatica e Automazione Computer Networks Research Group Version Author(s)

Domain Name System (DNS) Session-1: Fundamentals. Ayitey Bulley

DNS : Domain Name System

Copyright International Business Machines Corporation All rights reserved. US Government Users Restricted Rights Use, duplication or disclosure

How to Configure Split DNS

Networking Domain Name System

Deploying & Configuring a DNS Server on OpenServer 6 or UnixWare 7. Kirk Farquhar

- Domain Name System -

DNS at NLnet Labs. Matthijs Mekking

How to Add Domains and DNS Records

Tunnel Client FAQ. Table of Contents. Version 0v5, November 2014 Revised: Kate Lance Author: Karl Auer

Work No. 1 Samba. What is Samba?

Enterprise Architecture Office Resource Document Design Note - Domain Name System (DNS)

DNS + DHCP. Michael Tsai 2015/04/27

HTG XROADS NETWORKS. Network Appliance How To Guide: DNS Delegation. How To Guide

DNS. Computer networks - Administration 1DV202. fredag 30 mars 12

Some advanced topics. Karst Koymans. Friday, September 11, 2015

Basic DNS Course. Module 1. DNS Theory. Ron Aitchison ZYTRAX, Inc. Page 1 of 24

Monitoring Techniques for Cisco Network Registrar

OCS Training Workshop LAB14. Setup

Building a Linux IPv6 DNS Server

Managing Users and Identity Stores

Copyright

FreeIPA Client and Server

Use Domain Name System and IP Version 6

DNS. Computer Networks. Seminar 12

Configuring the BIND name server (named) Configuring the BIND resolver Constructing the name server database files

Network Registrar Data Backup and Recovery Strategies

Module 6: Managing and Monitoring Domain Name System

Understanding DNS (the Domain Name System)

DNS SECURITY TROUBLESHOOTING GUIDE

KB Windows 2000 DNS Event Messages 1 Through 1614

CSIS 3230 Computer Networking Principles, Spring 2012 Lab 7 Domain Name System (DNS)

LogLogic Microsoft Domain Name System (DNS) Log Configuration Guide

what s in a name? taking a deeper look at the domain name system mike boylan penn state mac admins conference

KAREL UCAP DNS AND DHCP CONCEPTS MANUAL MADE BY: KAREL ELEKTRONIK SANAYI ve TICARET A.S. Organize Sanayi Gazneliler Caddesi 10

How to Configure DNS Zones

CSE 127: Computer Security. Network Security. Kirill Levchenko

Teldat Router. DNS Client

The Use of DNS Resource Records

INTEGRATING VITALQIP WITH MICROSOFT WINDOWS NETWORKING/ ACTIVE DIRECTORY

DNS (Domain Name System) is the system & protocol that translates domain names to IP addresses.

Motivation. Domain Name System (DNS) Flat Namespace. Hierarchical Namespace

Enabling DNS for IPv6 CSD Fall 2011

Introduction to DNS and Application Issues related to DNS. Kirk Farquhar

Job Reference Guide. SLAMD Distributed Load Generation Engine. Version 1.8.2

Detecting rogue systems

Networking Domain Name System

Red Hat system-config-bind BIND (Berkeley Internet Name Domain) DNS ( Domain Name System)

2 HDE Controller X DNS Server Manual

Agenda. Network Services. Domain Names. Domain Name. Domain Names Domain Name System Internationalized Domain Names. Domain Names & DNS

Improving DNS performance using Stateless TCP in FreeBSD 9

Domain Name Servers. Domain Types WWW host names. Internet Names. COMP476 Networked Computer Systems. Domain Name Servers

State of the Cloud DNS Report

API of DNS hosting. For DNS-master and Secondary services Table of contents

Remote DNS Cache Poisoning Attack Lab

Snapt Redundancy Manual

Polycom RealPresence Resource Manager System Getting Started Guide

Network Working Group. Category: Best Current Practice S. Bradner Harvard University M. Patton Consultant July 1997

WatchGuard SSL v3.2 Update 1 Release Notes. Introduction. Windows 8 and 64-bit Internet Explorer Support. Supported Devices SSL 100 and 560

Using Webmin and Bind9 to Setup DNS Sever on Linux

# $ # % $ % $ % & ' $( # ) *$ mail.virgilio.it ftp.cs.cornell.edu

Application Protocols in the TCP/IP Reference Model

API V2.0. Documentation 7/28/2014

State of the Cloud DNS Report

Windows Active Directory. DNS, Kerberos and LDAP T h u r s d a y, J a n u a r y 2 7, 2011 INLS 576 Spring 2011

Using DC Agent for Transparent User Identification

Application Protocols in the TCP/IP Reference Model. Application Protocols in the TCP/IP Reference Model. DNS - Concept. DNS - Domain Name System

Automatic Configuration of Slave Nameservers (BIND only)

Active Directory LDAP Quota and Admin account authentication and management

Global Server Load Balancing (GSLB) Concepts

Section 1 Overview Section 2 Home... 5

LDAP and Active Directory Guide

Transcription:

FreeIPA Training Series DNS zone transfers from FreeIPA to non-freeipa slave servers FreeIPA 3.0 and bind-dyndb-ldap 2.3 Petr Špaček <pspacek@redhat.com< pspacek@redhat.com> 01-03-2013

Text file based (traditional) zones Zone = database used by DNS server. Text file, could be edited and distributed by hand. @ is a shorthand for zone origin, e.g. example.com. Zone origin will be appended to any name without period at the end. e.g. ns1 will be expanded to ns1.example.com. @ IN SOA ns1 mail ( ; Start of Authority record 78 ; serial number 1D ; refresh 1H ; retry 1W ; expire 3H ); minimum ; SOA record ends with ) ;name [TTL] class type record_content @ IN NS ns1 ; NS record ;line above will be expanded to: ;example.com. IN NS ns1.example.com. ns1 IN A 192.0.2.1 ; glue record 2 FreeIPA Training Series

Zone transfer DNS protocol allows copying of the zone (database) from one host to another. Traditional one master-multiple slaves schema. Slave servers have read-only copy of the database, all updates have to be made on the master server single point of failure for DNS dynamic updates. Slave servers provide redundancy and allow loadbalancing for read only queries. Slave servers have to be specified in NS records otherwise clients will ignore them. Zone is periodically transferred from master to slaves. 3 FreeIPA Training Series

Zone transfer Parameters of the zone transfer are specified in SOA (Start of Authority) record. It will be described later. SOA serial number ( database version ) on master and slave is compared before each zone transfer: No transfer is done when (master_serial <= slave_serial) DNS protocol has two standard types of zone transfer: AXFR full transfer, classical way, RFC 5936 IXFR incremental transfer, only changes made between old and new serial number are transferred, RFC 1995 4 FreeIPA Training Series

Start of Authority (SOA) record ( ; SOA starts as each other record, ( ) allow splitting over lines @ ; record name = zone origin (example.com.) 1W ; optional, Time-To-Live for caches (1 week, i.e. 604800 seconds) IN ; optional, class Internet, other classes (CHaos) are usually unused SOA ; record type = Start of Authority ; SOA record specifics starts here, as defined by RFC 1035 section 3.3.13. ns1 ; master server name, all dynamic updates should go here hostmaster ; e-mail of DNS server admin 78 ; SOA serial, database version number, RFC 1982 1D ; refresh, time interval between two successive zone transfers 1H ; retry, time interval before a failed refresh should be retried 1W ; expire, upper time limit on the cache before the zone is no longer ; authoritative. Slave will stop serving this zone a week after the last ; successful zone transfer. 3H ; minimum, TTL for negative cache, RFC 2308 ) 5 FreeIPA Training Series

A note about SOA serial numbers SOA serial serial is unsigned 32 bit integer. Value 0 can trigger bugs in some software, please start with 1. Range: 1 2 32-1 (i.e. 1 4 294 967 295) It can safely overflow (modulo arithmetic): Maximal defined addition is 2 31-1, i.e. 2 147 483 647 Bigger addition will result in wrong comparison results. 1 is smaller than 2 000 000 000 2 000 000 000 is smaller than 4 000 000 000 4 000 000 000 is smaller than 1 RFC 1982 contain all the gory details. 6 FreeIPA Training Series

DNS Notify (RFC 1996) Disadvantages of periodical zone pooling (quotation from RFC 1996): Longer refresh times are beneficial in that they reduce load on the master servers, but that benefit comes at the cost of long intervals of incoherence among authority servers whenever the zone is updated. The DNS NOTIFY transaction allows master servers to inform slave servers when the zone has changed an interrupt as opposed to poll model which it is hoped will reduce propagation delay while not unduly increasing the masters' load. Notification is sent to all servers listed in NS records. 7 FreeIPA Training Series

DNS Notify (RFC 1996) Slave after receiving a NOTIFY message have to: Do normal DNS query for SOA record from affected zone. Compare SOA serial from local copy with SOA serial on master server. Start zone transfer only if (slave_serial < master_serial). As a result, DNS NOTIFY mechanism and zone transfers will not work without proper SOA serial maintenance (incrementation after each change in the zone). 8 FreeIPA Training Series

Configuring zone transfers without FreeIPA Master side /etc/named.conf zone "example.com." IN { type master; file "master/example.com"; allow-transfer { 203.0.113.0/29; }; }; Slave side /etc/named.conf zone "example.com." IN { type slave; file "slave/example.com"; masters { 192.0.2.1; }; }; 9 FreeIPA Training Series

Zone transfer with NOTIFY in logs Master side /var/log/messages zone example.com/in: sending notifies (serial 101) client 203.0.113.1#43793: transfer of 'example.com/in': AXFR-style IXFR started client 203.0.113.1#43793: transfer of 'example.com/in': AXFR-style IXFR ended Slave side /var/log/messages client 192.0.2.1#41290: received notify for zone 'example.com' zone example.com/in: Transfer started. transfer of 'example.com/in' from 192.0.2.1#53: connected using 203.0.113.1#43793 zone example.com/in: transferred serial 101 transfer of 'example.com/in' from 192.0.2.1#53: Transfer completed: 1 messages, 237 records, 5673 bytes, 0.002 secs (2836500 bytes/sec) zone example.com/in: sending notifies (serial 101) 10 FreeIPA Training Series

FreeIPA specifics DNS data in LDAP FreeIPA replaced traditional text file with tree of objects stored in LDAP database. DNS server BIND 9 uses bind-dyndb-ldap plugin for accessing the database. Zone transfer mechanism between FreeIPA servers is not necessary because whole LDAP database is replicated between all FreeIPA servers. Replication is done by 389 DS. DNS server doesn't have to care about data synchronization (in ideal case). FreeIPA supports traditional zone transfer method for non FreeIPA slaves. It didn't work well with bind-dyndb-ldap < 2.0. 11 FreeIPA Training Series

FreeIPA specifics problems with LDAP database Single database shared and replicated between all DNS servers brings some new problems: Administration tools can change DNS data on any server at any time. DNS server has to notice the change. SOA serial has to be incremented after each change. Replication between FreeIPA servers takes some time. Different DNS servers will see changes in different time and potentially in different order. Replication of serial numbers could create race conditions. Perfect global synchronization of SOA serial could be very complex and expensive. 12 FreeIPA Training Series

Automatic SOA serial number incrementation FreeIPA hack: Each DNS server maintains own serial number independently, each server can return different SOA serial value. DNS server watches LDAP DB with persistent search. (ancient RFC draft-ietf-ldapext-psearch-03) 389 DS sends Entry Change Notification to DNS server after each change. Each change in LDAP database triggers SOA serial incrementation in DNS server according to following algorithm: If (old_serial < current_unix_timestamp) new_serial = current_unix_timestamp else if (old_serial >= current_unix_timestamp) new_serial = old_serial + 1 13 FreeIPA Training Series

Configuration: allowing zone transfer from FreeIPA Set allow-transfer attribute in specific DNS zone. Syntax is exactly same as in named.conf: Bare IP address and network/mask are accepted. It is possible to mix IPv4 and IPv6 addresses. BIND keywords any and none (default). $ ipa dnszone-mod example.com '--allowtransfer=192.0.2.8;203.0.113.0/29;2001:d B8:AA::1;2001:DB8:BB::/64;' (Semicolon has to be handled specially in BASH.) This configuration allows zone transfer but doesn't solve SOA serial incrementation. 14 FreeIPA Training Series

Configuration: SOA serial autoincrementation FreeIPA 3.0 should configure SOA serial autoincrementation by default! LDAP attribute idnssoaserial must not be replicated between FreeIPA servers. E.g. replication agreement with server ipa2.example.com is stored in LDAP under DN: cn=metoipa2.example.com,cn=replica,cn =dc\3dexample\,dc\3dcom,cn=mapping tree,cn=config Attribute nsds5replicatedattributelist has to contain idnssoaserial (among others). 15 FreeIPA Training Series

Configuration: SOA serial autoincrementation FreeIPA 3.0 configures SOA serial auto-incrementation by default! This is what is added to /etc/named.conf by FreeIPA installer: dynamic-db "ipa" { arg "psearch yes"; arg "zone_refresh 0"; arg "serial_autoincrement yes"; } Persistent search is required for serial_autoincrement. Zone refresh has to be disabled (0 or option not present). Persistent search and zone refresh are mutually exclusive. 16 FreeIPA Training Series

Configuration: SOA serial initialization: new zones Recommendation: Set initial SOA serial number to some small number (e.g. 1) when adding a new zone to FreeIPA. SOA serial will be immediately replaced with current UNIX timestamp if serial auto-incrementation is already enabled. This will allow to serial to follow real UNIX timestamp, as described on previous slide Automatic SOA serial number incrementation Theoretically, all FreeIPA servers should present SOA serial close to timestamp of last update. This could help non-freeipa slaves with failover between masters. 17 FreeIPA Training Series

Configuration: SOA serial initialization: existing zones Before the very first zone transfer please reset SOA serial in a zone to value smaller than current UNIX timestamp (to e.g. 1). This prevents situation where serial > current UNIX timestamp, i.e. serial will not contain timestamp from the future. Do the reset only once, before you start with zone transfer to non-freeipa slaves first time. This reset could help non-freeipa slaves with failover between masters. Serial incrementation algorithm is on previous slide Automatic SOA serial number incrementation 18 FreeIPA Training Series

Testing zone transfers Use dig from bind-utils package $ dig @DNS_server_IP -t AXFR +multiline example.com should list all records in the zone (some parts cut): ; <<>> DiG 9.8.2rc1 <<>> -t AXFR example.com @192.0.2.1 +multiline ;; global options: +cmd example.com. 86400 IN SOA ipa.example.com. hostmaster.example.com. ( 1357314370 ; serial 3600 ; refresh (1 hour) 900 ; retry (15 minutes) 1209600 ; expire (2 weeks) 3600 ; minimum (1 hour) ; Usage according to RFC 2308 ) example.com. 86400 IN NS ipa.example.com. ipa.example.com. 86400 IN A 192.0.2.1 example.com. 86400 IN SOA ipa.example.com. hostmaster.example.com. ( <snip> ) <snip> ;; XFR size: 4 records (messages 1, bytes 149) SOA record should appear twice (as the first and last transferred record) 19 FreeIPA Training Series

Debugging zone transfers Zone transfer with dig failed: ; <<>> DiG 9.8.2rc1 <<>> ;; global options: +cmd ; Transfer failed. Check the logs on DNS (FreeIPA) server: /var/log/messages /var/named/data/named.run Location is defined by directory and logging & channel & file directives in named.conf. 20 FreeIPA Training Series

Debugging zone transfers: incorrect allowtransfer ACL BIND log should say: named[4241]: client 192.0.2.9#44656: zone transfer 'example.com/axfr/in' denied Add 192.0.2.9 to allow-transfer ACL. You used @IPv4 as server's address but log say: named[4241]: client ::ffff:192.0.2.9#51276: zone transfer 'example.com/axfr/in' denied => Your kernel is a a bit quirky... Try one of following: a)add match-mapped-addresses yes; to options section in /etc/named.conf b)add ::ffff:192.0.2.9 addresses to allowtransfer ACL 21 FreeIPA Training Series

Debugging zone transfers: zone is not active BIND log should say: named[4241]: client 192.0.2.9#34772: bad zone transfer request: 'example.com/in': non-authoritative zone (NOTAUTH) Zone example.com is not an active zone on the DNS server. Is the zone enabled? $ ipa dnszone-show example.com. Zone name: example.com <snip> Active zone: FALSE 22 FreeIPA Training Series

Debugging zone transfers: zone is invalid Zone is invalid when some requirements for DNS zones are not satisfied. E.g. NS records don't have corresponding A/AAAA (so-called glue) records. BIND doesn't log anything about the zone transfer in this case, but zone inconsistency is logged: named[2310]: zone example.com/in: NS 'ns1.example.com' has no address records (A or AAAA) named[2310]: zone example.com/in: not loaded due to errors. Query for SOA record if nothing was logged: $ dig -t SOA @DNS_server_IP example.com <snip> ;; Got answer: ;; ->>HEADER<<- opcode: QUERY, status: SERVFAIL 23 FreeIPA Training Series

Debugging zone transfers: connection failed Firewall or DNS server is improperly configured or is not running. $ dig -t AXFR @DNS_server_IP example.com ;; Connection... failed: connection refused. ;; connection timed out; no servers could be reached UDP and TCP port 53 have to be opened in firewall (even for regular DNS clients): RFC 5966 section 1 Query for SOA record usually uses UDP: $ dig -t SOA @DNS_server_IP example.com <snip> ;; Got answer: ;; ->>HEADER<<- opcode: QUERY, status: NOERROR 24 FreeIPA Training Series

Debugging zone transfers: connection failed Big answers can't be transferred without TCP (some TXT records were added to the zone for this test): $ dig -t TXT @DNS_server_IP example.com ;; Truncated, retrying in TCP mode. ;; Connection... failed: connection refused. Check listen directives in /etc/named.conf if firewall is opened: options { // turns on IPv6 for port 53 // IPv4 is on by default for all ifaces listen-on-v6 {any;}; } 25 FreeIPA Training Series

Limitations Bind-dyndb-ldap supports only full zone transfers (AXFR). Whole zone is transferred each time. Generally, slave servers can't fail over between different FreeIPA masters because each FreeIPA server maintains own independent SOA serial number. Fail-over could work in environments with update rate smaller than 1 change per second. In that case SOA serial number should be nearly same on all hosts. multi-master option in BIND 9.9.2 affects only logging but not the zone transfer logic. It will not help with fail-over! 26 FreeIPA Training Series