Page tree

Welcome to FreeSoftwareServers Confluence Wiki

Skip to end of metadata
Go to start of metadata

Note: While I figured this out after a LOT of trial and error, I ultimately don't need it @ home and use DNSMasq now for DHCP and DNS in the same config file and LOVE it. If you use bind, you will probably want to check out ISC-DHCP-SERVER

INSTALL BIND SCRIPT

FIND AND REPLACE THE FOLLOWING: 

/etc/hostname   = [DNS_SERVER_NAME]
/etc/hosts 	= [DNS_SERVER_NAME].[DNS_SERVER_DOMAIN].local   [DNS_SERVER_NAME]
DNS Server IP   = [DNS_SERVER_IP]/24
TEST HOST       = [EXAMPLE_HOSTNAME]
TEST HOST IP    = [EXAMPLE_IP]

Prep Server 

sudo nano /etc/hostname && sudo nano /etc/hosts && sudo nano /etc/network/interfaces && sudo reboot 

Install and Configure Bind9

sudo apt-get update && echo y | sudo apt-get install bind9 bind9utils bind9-doc && sudo nano /etc/bind/named.conf.options && sudo nano /etc/bind/named.conf.local && sudo nano /etc/bind/forward.[DNS_SERVER_DOMAIN] && sudo nano /etc/bind/reverse.[DNS_SERVER_DOMAIN] && sudo chmod -R 755 /etc/bind && sudo chown -R bind:bind /etc/bind && sudo service bind9 restart 

%/etc/bind/named.conf.options

options {
        directory "/var/cache/bind";
        forwarders {
                8.8.8.8;
                8.8.4.4;
        };

%/etc/bind/named.conf.local
zone "[DNS_SERVER_DOMAIN].local" {
        type master;
        file "/etc/bind/forward.[DNS_SERVER_DOMAIN]";
 };
zone "1.168.192.in-addr.arpa" {
        type master;
        file "/etc/bind/reverse.[DNS_SERVER_DOMAIN]";
 }; 

%/etc/bind/forward.[DNS_SERVER_DOMAIN]

$TTL 86400
@   IN  SOA     [DNS_SERVER_NAME].[DNS_SERVER_DOMAIN].local. root.[DNS_SERVER_DOMAIN].local. (
        2011071001  ;Serial
        3600        ;Refresh
        1800        ;Retry
        604800      ;Expire
        86400       ;Minimum TTL
)
@       IN  NS          [DNS_SERVER_NAME].[DNS_SERVER_DOMAIN].local.
@       IN  A           [DNS_SERVER_IP]
@       IN  A           [EXAMPLE_IP]
[DNS_SERVER_NAME]       IN  A   [DNS_SERVER_IP]
[EXAMPLE_HOSTNAME]          IN  A   [EXAMPLE_IP] 

%/etc/bind/reverse.[DNS_SERVER_DOMAIN]

$TTL 86400
@   IN  SOA     [DNS_SERVER_NAME].[DNS_SERVER_DOMAIN].local. root.[DNS_SERVER_DOMAIN].local. (
        2011071002  ;Serial
        3600        ;Refresh
        1800        ;Retry
        604800      ;Expire
        86400       ;Minimum TTL
)
@       IN  NS          [DNS_SERVER_NAME].[DNS_SERVER_DOMAIN].local.
@       IN  PTR         [DNS_SERVER_DOMAIN].local.
[DNS_SERVER_NAME]       IN  A   [DNS_SERVER_IP]
[EXAMPLE_HOSTNAME]          IN  A   [EXAMPLE_IP]
101     IN  PTR         [DNS_SERVER_NAME].[DNS_SERVER_DOMAIN].local.
103     IN  PTR         [EXAMPLE_HOSTNAME].[DNS_SERVER_DOMAIN].local. 

TESTING!

The following should return nothing!

sudo named-checkzone [DNS_SERVER_DOMAIN].local /etc/bind/forward.[DNS_SERVER_DOMAIN]
sudo named-checkzone [DNS_SERVER_DOMAIN].local /etc/bind/reverse.[DNS_SERVER_DOMAIN] 
 And you should be able to PING
ping [EXAMPLE_HOSTNAME].[DNS_SERVER_DOMAIN].local
  • No labels