DNS and LDAP persistent search



Similar documents
DNS zone transfers from FreeIPA to non-freeipa slave servers

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

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

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

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

Managing DNS Server Properties

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

Unbound a caching, validating DNSSEC resolver. Do you trust your name server? Configuration. Unbound as a DNS cache (SEC-less)

Remote DNS Cache Poisoning Attack Lab

How-to: DNS Enumeration

Domain Name System (DNS) Fundamentals

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

Monitoring Techniques for Cisco Network Registrar

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

Domain Name System Security

How to Add Domains and DNS Records

DNS SECURITY TROUBLESHOOTING GUIDE

ms-help://ms.technet.2005mar.1033/enu_kbntrelease/ntrelease/ htm

Domain Name Server. Training Division National Informatics Centre New Delhi

DNS Pharming Attack Lab

Step-by-Step DNSSEC-Tools Operator Guidance Document

Module 2. Configuring and Troubleshooting DNS. Contents:

2 HDE Controller X DNS Server Manual

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

Hansoft LDAP Integration

netkit lab load balancer dns 1.2 Massimo Rimondini Version Author(s)

LDAP and Active Directory Guide

LogLogic Microsoft Domain Name System (DNS) Log Configuration Guide

DNS and Interface User Guide

KB Windows 2000 DNS Event Messages 1 Through 1614

Configuring DNS. Finding Feature Information

DNS Resolving using nslookup

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

dnsperf DNS Performance Tool Manual

Lecture 2 CS An example of a middleware service: DNS Domain Name System

Domain Name System. DNS is an example of a large scale client-server application. Copyright 2014 Jim Martin

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

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

DNS: How it works. DNS: How it works (more or less ) DNS: How it Works. Technical Seminars Spring Paul Semple psemple@rm.

Module 6: Managing and Monitoring Domain Name System

Configuring and Using the TMM with LDAP / Active Directory

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

SSSD DNS Improvements in AD Environment

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

Work No. 1 Samba. What is Samba?

Getting Started with AWS. Hosting a Static Website

SI455 Advanced Computer Networking. Lab2: Adding DNS and Servers (v1.0) Due 6 Feb by start of class

How to set up the Integrated DNS Server for Inbound Load Balancing

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

Securing an Internet Name Server

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

DNS. DNS Fundamentals. Goals of this lab: Prerequisites: LXB, NET

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

FreeIPA Client and Server

DNS + DHCP. Michael Tsai 2015/04/27

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

ACS 5.x and later: Integration with Microsoft Active Directory Configuration Example

Simple DNS Configuration Example

Domain Name System Server Round-Robin Functionality for the Cisco AS5800

The Use of DNS Resource Records

Cryoserver Archive Lotus Notes Configuration

Course 2277: Implementing, Managing, and Maintaining a Microsoft Windows Server 2003 Network Infrastructure: Network Services

Computer Networks 1 (Mạng Máy Tính 1) Lectured by: Dr. Phạm Trần Vũ MEng. Nguyễn CaoĐạt

Defending against DNS reflection amplification attacks

Understanding DNS (the Domain Name System)

FreeIPA 3.3 Trust features

Wireshark Lab: DNS. 1. nslookup

Teldat Router. DNS Client

DNS at NLnet Labs. Matthijs Mekking

DNS and BIND Primer. Pete Nesbitt linux1.ca. April 2012

Dr.Backup Release Notes - Version

DNS Service on Linux. Supawit Wannapila CCNA, RHCE

Wireshark DNS. Introduction. nslookup

How to Configure Dynamic DNS on a Virtual Access Router

Using Redis as a Cache Backend in Magento

Websense Support Webinar: Questions and Answers

Thales nshield HSM. Integration Guide for ISC BIND DNSSEC.

Understand Troubleshooting Methodology

Handling POSIX attributes for trusted Active Directory users and groups in FreeIPA

Understanding DNS By Robert Sterler

Microsoft Windows Server 2008 Active Directory, Configuring

Apache Traffic Server Extensible Host Resolution

Integrating Red Hat Enterprise Linux 6 with Microsoft Active Directory Presentation

Managing Users and Identity Stores

Building a Linux IPv6 DNS Server

Internet-Praktikum I Lab 3: DNS

Security Provider Integration LDAP Server

DnsCluster: A networking tool for automatic domain zone updating

Security Content Update Release Notes for CCS Update

Domain Name System (DNS) RFC 1034 RFC

Dave Stokes MySQL Community Manager

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

Adding Advanced Caching and Replication Techniques to the Apache Web Server

Transcription:

FreeIPA Training Series DNS and LDAP persistent search FreeIPA 3.0 and bind-dyndb-ldap 2.3 Petr Špaček <pspacek@redhat.com< pspacek@redhat.com> 01-14-2013

FreeIPA DNS integration FreeIPA is able to store DNS zones in LDAP database as a tree of objects. DNS server BIND 9 uses bind dyndb ldap plugin for accessing the database. Configuration related to DNS is stored in LDAP and partially in /etc/named.conf on each FreeIPA server. Bind dyndb ldap supports two modes of operation: Polling mode (legacy, used before FreeIPA 3.0) Persistent search mode (used in FreeIPA 3.0) 2 FreeIPA Training Series

Polling mode (before FreeIPA 3.0) LDAP database is periodically checked for new or modified DNS zones. Default period was 30 or 60 seconds, see zone_refresh parameter in /etc/named.conf on specific server. DNS server will notice added or deleted a zone with delay [0, zone_refresh] seconds. DNS records requested by clients are cached in DNS server's memory to lower a load of LDAP server. Default cache TTL was 120 seconds, see cache_ttl parameter in /etc/named.conf on specific server. DNS server will notice changed record with delay [0, cache_ttl] seconds. 3 FreeIPA Training Series

Polling mode: configuration FreeIPA before version 3.0 will configure poling mode automatically! In /etc/named.conf: dynamic-db "ipa" { library "ldap.so"; <snip> arg "zone_refresh 30"; }; Bind-dyndb-ldap (ldap.so) has built-in defaults: cache_ttl = 120 seconds psearch = no 4 FreeIPA Training Series

Polling mode: zones New domain will be visible after [0, zone_refresh] seconds. Same rule applies to zone enabling/deleting/disabling. [12:41:59]$ dig @127.0.0.1 example.test. ;; ->>HEADER<<- opcode: QUERY, status: NXDOMAIN, id: 14361 [12:41:59]$ ipa dnszone-add example.test. \ --name-server=ipa.corp.test. \ --admin-email=hostmaster.corp.test. [12:42:00]$ dig @127.0.0.1 example.test. ;; ->>HEADER<<- opcode: QUERY, status: NXDOMAIN, id: 35154 [12:42:30]$ dig @127.0.0.1 example.test. ;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 31693 5 FreeIPA Training Series

Polling mode: new records New records are visible immediately because there is no negative caching in database back-end. [13:11:23]$ ipa dnsrecord-add example.test. \ newrec '--txt-rec="""created on 13:11:23"""' [13:11:24]$ dig @127.0.0.1 -t TXT newrec.example.test. ;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 59911 ;; ANSWER SECTION: newrec.example.test. 86400 IN TXT "created on 13:11:23" 6 FreeIPA Training Series

Polling mode: modified/deleted records Record modification/deletion will be visible after [0, cache_ttl] seconds after the last query. [13:11:24]$ ipa dnsrecord-mod example.test. \ newrec '--txt-rec="""created on 13:11:23"""' \ --txt-data="this is newer :-)" Record name: newrec TXT record: "this is newer :-)" [13:11:25]$ dig @127.0.0.1 -t TXT newrec.example.test. ;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 24615 ;; ANSWER SECTION: newrec.example.test. 86400 IN TXT "created on 13:11:23" [13:13:25]$ dig @127.0.0.1 -t TXT newrec.example.test. ;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 43599 ;; ANSWER SECTION: newrec.example.test. 86400 IN TXT "this is newer :-)" 7 FreeIPA Training Series

Persistent search mode (from FreeIPA 3.0) DNS server watches LDAP DB with persistent search. (ancient RFC draft-ietf-ldapext-psearch-03) Any change in LDAP should be noticed by DNS server nearly immediately. LDAP replication between FreeIPA servers can delay propagation of changes. It depends on replication topology, link latency etc. No periodic queries to LDAP server are done. Cache TTL is infinity: LDAP server will be asked for the same record only once. 8 FreeIPA Training Series

Persistent search mode: configuration FreeIPA version 3.0 will configure persistent search mode automatically! In /etc/named.conf: dynamic-db "ipa" { library "ldap.so"; <snip> arg "zone_refresh 0"; arg "psearch yes"; }; Bind-dyndb-ldap (ldap.so) in persistent search mode ignores built-in cache_ttl. zone_refresh and psearch are mutually exclusive. 9 FreeIPA Training Series

Persistent search mode: zones New domain will be visible nearly immediately. Same rule applies to zone enabling/deleting/disabling. [15:31:49]$ dig @127.0.0.1 example.test. ;; Got answer: ;; ->>HEADER<<- opcode: QUERY, status: NXDOMAIN, id: 58617 [15:31:49]$ ipa dnszone-add example.test. \ --name-server=ipa.corp.test. \ --admin-email=hostmaster.corp.test. [15:31:50]$ dig @127.0.0.1 example.test. ;; Got answer: ;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 59435 10 FreeIPA Training Series

Persistent search mode: zones known BUG! bind-dyndb-ldap 2.3 + FreeIPA 3.0 contain a bug a new zone with relative name of name server could return SERVFAIL until BIND reload. Red Hat bug 893571. The zone is visible immediately if you are lucky. Workaround - reload BIND with one of the commands: rndc reload or service named restart [15:38:36]$ dig @127.0.0.1 example.test. ;; ->>HEADER<<- opcode: QUERY, status: NXDOMAIN, id: 39982 [15:38:36]$ ipa dnszone-add example.test. \ --name-server=ns \ --ip-address=192.0.2.1 \ --admin-email=hostmaster.example.test. [15:38:37]$ dig @127.0.0.1 example.test. ;; ->>HEADER<<- opcode: QUERY, status: SERVFAIL, id: 56265 11 FreeIPA Training Series

Persistent search mode: records Any record operation will be visible nearly immediately. [15:46:00]$ ipa dnsrecord-add example.test. \ newrec '--txt-rec="""created on 15:01:00"""' [15:46:01]$ dig @127.0.0.1 -t TXT newrec.example.test. ;; ANSWER SECTION: newrec.example.test. 86400 IN TXT "created on 15:01:00" [15:46:01]$ ipa dnsrecord-mod example.test. newrec \ '--txt-rec="""created on 15:01:00"""' \ --txt-data="this is newer :-)" [15:46:02]$ dig @127.0.0.1 -t TXT newrec.example.test. ;; ANSWER SECTION: newrec.example.test. 86400 IN TXT "this is newer :-)" 12 FreeIPA Training Series

Bind dyndb ldap modes comparison Default in FreeIPA version Time to detect record change Time to detect zone change SOA serial auto-increment Polling Persistent search < 3.0 >= 3.0 up to 120 s immediately up to 30 s immediately* not supported supported** * Except the Red Hat bug 893571 ** Be aware of Red Hat bug 895083 13 FreeIPA Training Series

Debugging Intermediate servers can cache replies and cached records could hide real error sometimes. Query FreeIPA servers directly with command dig @IPA_server_IP_address /var/log/messages or BIND logs should contain some hints if something doesn't work as expected. 14 FreeIPA Training Series

Debugging: persistent search error messages Usually are in /var/log/messages Typical error message related to persistent search looks like (with added newlines): named[2310]: update_record (psearch) failed, dn 'idnsname=record,idnsname=zone.example.com, cn=dns,dc=example,dc=com' change type 0x4. Records can be outdated, run `rndc reload`: not found Last line with bold text contains error code. Not found meaning depends on context. Examine messages preceding and following this line to get some context. Raise debug level when it is still not clear. 15 FreeIPA Training Series

Debugging: not found errors named[2310]: update_record (psearch) failed, dn 'idnsname=record,idnsname=zone.example.com, cn=dns,dc=example,dc=com' change type 0x4. Records can be outdated, run `rndc reload`: not found It usually means object disappeared from the database before it was processed. Usually nothing to worry about. E.g. some administration tool (FreeIPA CLI) changed some attribute (change type 0x4) and then deleted the whole object. BIND attempted to fetch changed object (after attribute change) but object disappeared in meanwhile. E.g. records are added and deleted with speed BIND can't follow. E.g. all records and then whole zone was deleted too fast for BIND to follow. 16 FreeIPA Training Series

Debugging: zone not loaded named[2310]: update_record (psearch) failed, dn 'idnsname=record,idnsname=zone.example.com, cn=dns,dc=example,dc=com' change type 0x1. Records can be outdated, run `rndc reload`: zone not loaded (alternative error code is bad zone) It usually means object inside invalid zone changed. Examine logs for the reason why the zone is invalid. Missing glue records, missing NS records etc. Fix errors in zone data and reload BIND. Reload should be unnecessary after fixing Red Hat bug 893571. Manual intervention is inevitable in cases where zone data are invalid. 17 FreeIPA Training Series

Debugging: more verbose logs Debugging messages are usually sent to /var/named/data/named.run Use rndc debug trace <level> to raise log level. 0 is the default. Keyword notrace disables debugging. 20 will print huge amount of data including each event received through persistent search mechanism and each LDAP query. Enable verbose checks in /etc/named.conf: dynamic-db "ipa" { arg "verbose_checks yes"; }; Verbose_checks are not supported in bind-dyndb-ldap <= 2.3. 18 FreeIPA Training Series

DNS caching: authoritative server Each DNS record has own TTL value. TTL value is in the second column of answer section, in following examples written in bold font. FreeIPA uses 86400 seconds (1 day) as default value. TTL was artificially lowered to 60 seconds for following examples. [11:18:54]$ dig @IPA ipa.corp.test. ;; ANSWER SECTION: ipa.corp.test. 60 IN A 192.0.2.1 [11:19:05]$ dig @IPA ipa.corp.test. ;; ANSWER SECTION: ipa.corp.test. 60 IN A 192.0.2.1 19 FreeIPA Training Series

DNS caching: authoritative server Model situation: ipa is authoritative DNS server, cache is some random recursive caching DNS server in the world. Answers from authoritative servers are always fresh, i.e. answers have TTL as specified in zone. Changes are visible immediately if persistent search is enabled. [11:18:54]$ dig @IPA ipa.corp.test. ;; ANSWER SECTION: ipa.corp.test. 60 IN A 192.0.2.1 [11:19:05]$ dig @IPA ipa.corp.test. ;; ANSWER SECTION: ipa.corp.test. 60 IN A 192.0.2.1 20 FreeIPA Training Series

DNS caching: caching server: positive cache Caching servers obtain answers from some other servers, authoritative or also caching. TTL contained in each cached record is used as counter for count down. TTL is decremented by 1 each second and the cached record is flushed when TTL reaches 0. Remaining TTL value is sent to the client as part of the answer. Remaining TTL is propagated downstream, from authoritative servers through the whole tree of caching servers to the clients. 21 FreeIPA Training Series

DNS caching: caching server: positive cache A record for ipa.corp.test. is retrieved at the first request, timestamp 11:19:05. Next query for the same record is answered from the cache. TTL in the second answer is lower than TTL in the first ( fresh ) reply. The record is served from the cache until TTL drops to zero. Any change immediately visible on authoritative server will be hidden until cache expires! [11:19:05]$ dig @CACHE ipa.corp.test. ;; ANSWER SECTION: ipa.corp.test. 60 IN A 192.0.2.1 [11:19:15]$ dig @CACHE ipa.corp.test. ;; ANSWER SECTION: ipa.corp.test. 50 IN A 192.0.2.1 22 FreeIPA Training Series

DNS caching: caching server: negative cache Answers for non-existing names obtained from caching non-authoritative servers behaves in the same way. Only difference is how initial TTL is determined. [11:24:12]$ dig +multiline @CACHE blah.corp.test. ;; ->>HEADER<<- opcode: QUERY, status: NXDOMAIN, id: 1523 ;; AUTHORITY SECTION: ipa.corp.test. 60 IN SOA ipa.corp.test. ( <snip> 3600 ; minimum (1 hour) ) [11:24:21]$ dig +multiline @CACHE blah.corp.test. ;; ->>HEADER<<- opcode: QUERY, status: NXDOMAIN, id: 22846 ;; AUTHORITY SECTION: ipa.corp.test. 51 IN SOA ipa.corp.test. ( <snip> 13 86400 3600 604800 3600 ) 23 FreeIPA Training Series

DNS caching: caching server: negative cache Effective TTL for negative cache is minimum from pair (SOA record minimum, SOA record TTL), i.e. 60 seconds in the following example: $ dig @127.0.0.1 +multiline blah.corp.test. ;; AUTHORITY SECTION: ipa.corp.test. 60 IN SOA ipa.corp.test. hm.corp.test. ( 13 ; serial 86400 ; refresh (1 day) 3600 ; retry (1 hour) 604800 ; expire (1 week) 3600 ; minimum (1 hour) ) 24 FreeIPA Training Series

DNS caching: caching server: manipulating cache BIND command rndc flush will clean server's local cache. rndc dumpdb -cache will save current cache to file /var/named/data/cache_dump.db Dump has classical DNS zone format. 25 FreeIPA Training Series

DNS caching: recommendation 1.Don't use extremely small values for TTL (seconds) for normal operation. It will add a lot of network round trips and raise latency visible by end users. 2.Plan changes in DNS carefully :-) 3.Lower TTL for affected records to some small value (e.g. 60 seconds). 4.Wait until original (longer) TTL expires. 5.Do the changes. 6.Test changes thoroughly. 7.Raise TTL to original value if everything works. 26 FreeIPA Training Series

Limitations Persistent search is expected to consume a lot of resources in 389DS. Persistent search can't detect object renaming (LDAP moddn operation) if the new DN is outside of cn=dns subtree. It normally should not happen. Some people use bind-dyndb-ldap with OpenLDAP but OpenLDAP doesn't support persistent search (ancient RFC draft-ietf-ldapext-psearch-03), only the newer SyncRepl (RFC 4533) mechanism. Patches are welcome :-) 27 FreeIPA Training Series