| Recursive Server 101 |
| Ed Lewis | |
| edlewis@arin.net | |
| Overview |
| Recursive Service | |
| root server list | |
| localhost. | |
| 0.0.127.in-addr.arpa. | |
| named.conf |
| Recursive Server |
| Used to lookup data by applications | ||
| Needs to know how to reach top of DNS | ||
| Also should stop some queries | ||
| localhost, 127.0.0.1 | ||
| Files | ||
| named.conf | ||
| root.hints | ||
| localhost zone | ||
| 0.0.127.in-addr.arpa zone | ||
| We'll do named.conf last | ||
| Root Server List |
| List of the 13 root server records | |||
| Where to get it | |||
| ftp rs.internic.net | |||
| anonymous login | |||
| cd domain | |||
| get one of these files (they are [nearly] the same) | |||
| db.cache | |||
| named.root | |||
| named.cache | |||
| What it looks like |
| ; This file holds the information on root name servers needed to | |
| ; initialize cache of Internet domain name servers | |
| ; (e.g. reference this file in the "cache . <file>" | |
| ; configuration file of BIND domain name servers). | |
| ; | |
| ; This file is made available by InterNIC | |
| ; under anonymous FTP as | |
| ; file /domain/named.cache | |
| ; on server FTP.INTERNIC.NET | |
| ; | |
| ; last update: Nov 5, 2002 | |
| ; related version of root zone: 2002110501 | |
| ; | |
| ; | |
| ; formerly NS.INTERNIC.NET | |
| ; | |
| . 3600000 IN NS A.ROOT-SERVERS.NET. | |
| A.ROOT-SERVERS.NET. 3600000 A 198.41.0.4 | |
| ; | |
| ................. | |
| ; housed in Japan, operated by WIDE | |
| ; | |
| . 3600000 NS M.ROOT-SERVERS.NET. | |
| M.ROOT-SERVERS.NET. 3600000 A 202.12.27.33 | |
| ; End of File |
| What You Do To This File |
| Nothing | ||
| You will include it in named.conf | ||
| In real networks, don't change it | ||
| But for learning, we will change it | ||
| localhost |
| Loopback name in operating systems | ||
| Means 127.0.0.1 | ||
| Queries for this shouldn't use recursion | ||
| So we will configure a file to define the localhost. zone | ||
| Note the "." | ||
| localhost file |
| $ORIGIN localhost. | |
| $TTL 86400 | |
| @ IN SOA localhost. root.localhost. ( | |
| 1 ; serial | |
| 1800 ; refresh | |
| 900 ; retry | |
| 69120 ; expire | |
| 1080 ; negative cache ttl | |
| ) | |
| NS localhost. | |
| A 127.0.0.1 |
| Reverse for localhost |
| Since we want "localhost -> 127.0.0.1" we want to have "127.0.0.1 -> 127.0.0.1" | |
| We need a zone called 0.0.127.in-addr.arpa |
| 0.0.127.in-addr.arpa file |
| $ORIGIN 0.0.127.in-addr.arpa. | |
| $TTL 86400 | |
| @ IN SOA localhost. root.localhost. ( | |
| 1 ; serial | |
| 1800 ; refresh | |
| 900 ; retry | |
| 69120 ; expire | |
| 1080 ; negative cache ttl | |
| ) | |
| NS localhost. | |
| 1 PTR localhost. | |
| Assembling the files |
| Here's my directory: | ||
| [~/DNS/apricot2003/recursive] edlewis% ls | ||
| 0.0.127.in-addr.arpa. localhost. named.root | ||
| The directory name and file names will be in named.conf | ||
| Now I create a named.conf file in the same directory... | ||
| named.conf |
| options { | |
| directory "/Users/edlewis/DNS/apricot2003/recursive"; | |
| pid-file "/Users/edlewis/DNS/apricot2003/recursive/n.pid"; | |
| recursion yes; | |
| }; | |
| zone "." { | |
| type hint; | |
| file "named.root"; | |
| }; | |
| zone "localhost." { | |
| type master; | |
| file "localhost."; | |
| }; | |
| zone "0.0.127.in-addr.arpa." { | |
| type master; | |
| file "0.0.127.in-addr.arpa."; | |
| }; | |
| Running the server |
| From the directory | ||
| sudo named -c named.conf | ||
| Testing the server |
| Just to show it is alive | |||
| dig @127.0.0.1 www.arin.net | |||
| ; <<>> DiG 9.2.2rc1 <<>> @127.0.0.1 www.arin.net | |||
| ;; global options: printcmd | |||
| ;; Got answer: | |||
| ;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 16580 | |||
| ;; flags: qr rd ra; QUERY: 1, ANSWER: 2, AUTHORITY: 10, ADDITIONAL: 0 | |||
| ;; QUESTION SECTION: | |||
| ;www.arin.net. IN A | |||
| ;; ANSWER SECTION: | |||
| www.arin.net. 10800 IN A 192.149.252.17 | |||
| www.arin.net. 10800 IN A 192.149.252.16 | |||
| ;; AUTHORITY SECTION: | |||
| arin.net. 10800 IN NS arrowroot.arin.net. | |||
| (and so on) | |||
| ;; Query time: 3066 msec | |||
| ;; SERVER: 127.0.0.1#53(127.0.0.1) | |||
| ;; WHEN: Wed Feb 19 11:07:05 2003 | |||
| ;; MSG SIZE rcvd: 251 | |||
| Congratulations - Your First Server! |
| It's just the beginning... |
| Questions? |