Presentation is loading. Please wait.

Presentation is loading. Please wait.

中華技術學院 Linux 課程 中華技術學院 Linux 課程 Chap two : DNS 王俊城RHCE/RHCX.

Similar presentations


Presentation on theme: "中華技術學院 Linux 課程 中華技術學院 Linux 課程 Chap two : DNS 王俊城RHCE/RHCX."— Presentation transcript:

1 中華技術學院 Linux 課程 中華技術學院 Linux 課程 Chap two : DNS 王俊城RHCE/RHCX

2 Agenda  DNS overview  Configuring BIND  Creating BIND databases  Additional DNS methods  Using BIND tools

3 Domain Name System (DNS)  forward lookup  www.hinet.net -> 61.219.38.89 www.hinet.net  reverse lookup  61.219.38.89 -> www.hinet.net www.hinet.net  Logically group by name domains  Provides email routing information

4 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

5 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 /var/named/named.ca dig @168.95.192.1 dig @168.95.192.1

6 BIND  Berkeley Internet Name Domain (BIND)  BIND 9  /usr/share/doc/bind*/README  http://www.isc.org/products/B IND http://www.isc.org/products/B

7 Service Profile : DNS  Type:System V-manager service  Packages:bind,bind-utils caching-nameserveropenssl  Daemons:named  Script:named  Ports:UDP(53),TCP(53)  Configs:/etc/named.conf /var/named/named.ca/var/named/*  Log:/var/log/messages

8 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

9 Global Options acl "mynet" { 192.168.0/24; 192.168.1/24; }; 192.168.1/24; }; options { directory "/var/named"; forwards { 168.95.192.1; }; forward only; forward only; allow-query { mynet; }; allow-transfer { mynet; }; };

10 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 www.redhat.com  dig @168.95.192.1  nslookup is deprecated

11 LAB1-Cache-only DNS Server  /var/named/chroot/etc/named.conf  /etc/hosts  /etc/resolv.conf  service named restart  host station251.example.com options { directory "/var/named/chroot/var/named"; forwarders { 192.168.0.249; }; forward only; };

12 Slave Zones zone "example.com" { type slave; masters { 192.168.0.249; }; file "example.com.zone-slave"; }; zone "0.168.192.in-addr.arpa" { type slave; masters { 192.168.0.249; }; file "192.168.0.zone"; };

13 LAB2-Slave DNS Server  /var/named/chroot/etc/named.conf  /etc/hosts  /etc/resolv.conf  service named restart  host station251.example.com zone "example.com" { type slave; masters { 192.168.0.249; }; file "example.com.zone-slave"; }; zone "0.168.192.in-addr.arpa" { type slave; masters { 192.168.0.249; }; file "192.168.0.zone"; };

14 Master Zones zone "domain251.example.com" { type master; type master; file "domain251.example.com.zone"; file "domain251.example.com.zone";}; zone "0.168.192.IN-ADDR.ARPA" { type master; type master; file "192.168.0.251.zone"; file "192.168.0.251.zone";};

15 Special Zones  Root zone: “. ” zone "." { type hint; file "named.ca"; }; zone "0.0.127.in-addr.arpa" { type master; file "127.0.0.zone"; };

16 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 “ ; ”

17 Example Zone Files  SOA record  NS records  A records  CNAME records  MX records

18 Example Zone Files $TTL 86400 @ IN SOA station251.domain251.example.com. root.station251.domain251.example.com. ( ; Dont forget to increment the serial number 2003040100;serial number 2003040100;serial number 1H;refresh slave 1H;refresh slave 5M;retry refresh 5M;retry refresh 1W;expire zone 1W;expire zone 5M ;cache time-to-live for negative answers 5M ;cache time-to-live for negative answers) ; Name server resource records ( NS ) ; ownerTTL CL typeRDATA @ IN NSstation251.domain251.example.com. ; Mail exchanger resource records ( MX ) ; ownerTTL CL type RDATA domain251.example.com.IN MX 10 station251.domain251.example.com. ; Internet address resource records( A ) ; ownerTTLCL typeRDATA @IN A192.168.0.251 station251.domain251.example.com.IN A192.168.0.251

19 LAB2-Master DNS Server  /var/named/chroot/etc/named.conf  /etc/hosts  /etc/resolv.conf  service named restart  host station251.example.com zone “ domain251.example.com" { type master; file "domain251.example.com.zone"; };

20 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

21


Download ppt "中華技術學院 Linux 課程 中華技術學院 Linux 課程 Chap two : DNS 王俊城RHCE/RHCX."

Similar presentations


Ads by Google