210 likes | 362 Views
中華技術學院 Linux 課程. Chap two : DNS 王俊城 RHCE/RHCX. Agenda. DNS overview Configuring BIND Creating BIND databases Additional DNS methods Using BIND tools. Domain Name System (DNS). forward lookup www.hinet.net -> 61.219.38.89 reverse lookup 61.219.38.89 -> www.hinet.net
E N D
中華技術學院Linux課程 Chap two : DNS 王俊城 RHCE/RHCX
Agenda • DNS overview • Configuring BIND • Creating BIND databases • Additional DNS methods • Using BIND tools
Domain Name System (DNS) • forward lookup • www.hinet.net -> 61.219.38.89 • reverse lookup • 61.219.38.89 -> www.hinet.net • Logically group by name domains • Provides email routing information
Name Server Hierarchy • Master name server • maintain zone file itself • Slave name server • Provides a backup to the master name server • Synchronization with master or another slave name server • Cache-only • No any one zone file
DNS Server • Server receives request • If zone file have answer • If cache have answer • If forward assign • Asks root name server • /var/named/named.ca • dig @168.95.192.1
BIND • Berkeley Internet Name Domain (BIND) • BIND 9 • /usr/share/doc/bind*/README • http://www.isc.org/products/BIND
Service Profile : DNS • Type: System V-manager service • Packages: bind,bind-utils caching-nameserver openssl • Daemons: named • Script: named • Ports: UDP(53),TCP(53) • Configs: /etc/named.conf /var/named/named.ca /var/named/* • Log: /var/log/messages
Configuring BIND • /etc/named.conf • service named restart • Text-file specifying directives:zones,options,access control lists,etc • Comments can be in C,C++ or shell style • /* C style comment */ • // C++ style comment • # shell style comment
BIND utlities • host: gather host/domain information • host example.com • host –al example.com • host –t mx example.com • dig: send queries to name server directly • dig @168.95.192.1 www.redhat.com • dig @168.95.192.1 • nslookup is deprecated
LAB1-Cache-only DNS Server • /var/named/chroot/etc/named.conf • /etc/hosts • /etc/resolv.conf • service named restart • host station251.example.com
LAB2-Slave DNS Server • /var/named/chroot/etc/named.conf • /etc/hosts • /etc/resolv.conf • service named restart • host station251.example.com
Special Zones • Root zone: “.”
Zone Files • /var/named/* ( or /var/named/chroot/var/named/*) • Begin with $TTL (time to live) • First resource record is zone`s start of authority(SOA) • Zone data in additional resource records • Comments can be “;”
Example Zone Files • SOA record • NS records • A records • CNAME records • MX records
LAB2-Master DNS Server • /var/named/chroot/etc/named.conf • /etc/hosts • /etc/resolv.conf • service named restart • host station251.example.com
Delegating Subdomains • Configure the subdomain as a zone on the new server • On delegating server,set up NS record for the subdomain pointing to the new server • If new server is in subdomain it manages,on delegating server need a “glue” A record for new server