Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.

Bind How To

462 views

Published on

How to set up a Linux bind server.

Published in: Technology
  • Be the first to comment

  • Be the first to like this

Bind How To

  1. 1. Bind How-to REV 3 1. Do a Linux Server install and ensure that the DNS server is installed as an option. During the install, check the box for custom packages, then uncheck the XWindows and desktop options, as well as any server other than the DNS server. Install admin tools but not applications or programming tools. Set the hostname during install for whatever FQDN you will be using for the DNS server. I am using an example zone name of domain1.com. You should substitute your own domain name where ever you see the name domain1.com. 2. There are two file locations that you are concerned about. The /etc/named.conf file defines what zones are to be used. The /var/named/chroot/var/named directory holds the various zones files. The zone files define the host records for each zone. Once the named.conf file is setup, you just have to work with the zone files to add or delete host records. 3. Copy one of the generic zone files and rename it so you can start to set up your own zone. cp /var/named/chroot/var/named/localhost.zone /var/named/chroot/var/named/domain1.com.zone where “domain1.com is to be substituted with the name of your actual zone name. 4. Change the owner.group of the new file to the named user and group chown named.named /var/named/chroot/var/named/domain1.com.zone 5. Make a symbolic link: ln –s /var/named/chroot/var/named/doamin1.com.zone /var/named/domain1.com.zone 6. Edit the /etc/named.conf file and add the zone reference right after the zone “localhost” stanza. See attachment 1. 7. Change the file you made, /var/named/chroot/var/named/domain1.com.zone to the proper zone information. See attachment 2. 8. Add host names and IP addresses as needed. 9. Start DNS server using: service named start|stop|reload. Do a reload anytime the files are changed. 10. Check that the server is working by: a. Change the /etc/resolv.conf file to reflect your computers IP address. If this is to be a real DNS server, make the IP address 127.0.0.1 in resolv.conf b. Use the dig or nslookup or host commands to see if an IP address for a host name you put in the zone file will be given back to you. You should get an immediate lookup. Examples: [dig server1.domain1.com] [nslookup server1.domain1.com] host –v server1.domain1.com] Have verified by your instructor.
  2. 2. Attachment #1 /etc/named.conf options { directory "/var/named"; dump-file "/var/named/data/cache_dump.db"; statistics-file "/var/named/data/named_stats.txt"; allow-query { any; }; allow-transfer { any; }; }; controls { inet 127.0.0.1 allow { localhost; } keys { rndckey; }; }; zone "." IN { type hint; file "named.ca"; }; zone "localdomain" IN { type master; file "localdomain.zone"; allow-update { none; }; }; zone “localhost” IN { type master; file “localhost.zone”; allow-update { none; } }; zone "domain1.com" IN { type master; file "domain1.com.zone"; allow-update { none; }; }; zone "1.168.192.in-addr.arpa" IN { type master; file "192.168.1.zone"; allow-update { none; }; }; zone "0.0.127.in-addr.arpa" IN { type master; file "named.local"; allow-update { none; }; }; zone "255.in-addr.arpa" IN { type master; file "named.broadcast"; allow-update { none; }; }; zone “0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.ip6.arpa” IN { type master; file “named.ip6.local”; allow-update { none; }; }; zone "0.in-addr.arpa" { type master; file "named.zero"; allow-update { none; }; }; include "/etc/rndc.key";
  3. 3. Attachment # 2 File for /var/named/chroot/var/named/domain1.com.zone $TTL 86400 $ORIGIN domain1.com. // The above line specifies a domain name and will be appended // to any host name only, not a FQDN domain1.com. IN SOA server1.domain1.com. root.domain1.com ( 44 ; serial # for secondary updates 3H ; refresh after 3 hours 15M ; retry after 15 min 1W ; expire after 1 week 1D ) ; negative caching ttl domain1.com. NS server1.domain1.com. server1 IN A 192.168.1.6 www IN CNAME server1.domain1.com.

×