Difference between revisions of "Cluster der kan alt/Install DNS server"
From Teknologisk videncenter
								
												
				 (Created page with "=Installation af DNS=  Instruktioner   ==Installer DNS Server==  sudo apt-get install bind9  ==configure DNS (Bind)== Vi skal bruge 5 filer.   We will edit 3 files. #/etc/bind/na...")  | 
				|||
| Line 1: | Line 1: | ||
| − | |||
| − | |||
| − | |||
| − | |||
==Installer DNS Server==  | ==Installer DNS Server==  | ||
| + | Install DNS server by download and install the package   | ||
| + | <source lang=cli>  | ||
| + | apt-get install bind9  | ||
| + | </source>  | ||
| − | + | ==Configure DNS (Bind9)==  | |
| − | + | First we will edit these 3 files.  | |
| − | ==  | + | */etc/bind/named.conf.local  | 
| − | + | */etc/bind/named.conf.options  | |
| + | */etc/resolvconf/resolv.conf.d/base   | ||
| − | + | Second we will create these 2 files.  | |
| − | + | */etc/bind/zones/dka.local.db  | |
| − | + | */etc/bind/zones/rev.0.0.10.in-addr.arpa  | |
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
===First step: add domain zone – dka.local===  | ===First step: add domain zone – dka.local===  | ||
| − | + | Enter the named.conf.local file  | |
| − | + | <source lang=cli>  | |
| − | + | nano /etc/bind/named.conf.local  | |
| + | </source>  | ||
| + | Add the entire to the file  | ||
<source lang=cli>  | <source lang=cli>  | ||
# Our Domain zone  | # Our Domain zone  | ||
| Line 40: | Line 38: | ||
===Secund step: Add the DNS servers from your ISP===  | ===Secund step: Add the DNS servers from your ISP===  | ||
| − | + | <source lang=cli>  | |
| − | + | nano /etc/bind/named.conf.options  | |
| + | </source>  | ||
<source lang=cli>  | <source lang=cli>  | ||
         forwarders {  |          forwarders {  | ||
| Line 58: | Line 57: | ||
===Third step: Modify the resolv.conf file ===  | ===Third step: Modify the resolv.conf file ===  | ||
| − | + | nano /etc/resolvconf/resolv.conf.d/base  | |
<source lang=cli>  | <source lang=cli>  | ||
| Line 69: | Line 68: | ||
===Fourth step: Define zones===  | ===Fourth step: Define zones===  | ||
| − | + | mkdir /etc/bind/zones  | |
| − | + | nano /etc/bind/zones/dka.local.db  | |
<source lang=cli>  | <source lang=cli>  | ||
| Line 100: | Line 99: | ||
===Step five: Create a “rev.0.0.10.in-addr.arpa” file for reverse lookup===  | ===Step five: Create a “rev.0.0.10.in-addr.arpa” file for reverse lookup===  | ||
| − | + | nano /tec/bind/zones/rev.0.0.10.in-addr.arpa  | |
<source lang=cli>  | <source lang=cli>  | ||
| Line 129: | Line 128: | ||
nslookup ns  | nslookup ns  | ||
</source>  | </source>  | ||
| − | |||
{{Source cli}}  | {{Source cli}}  | ||
Revision as of 10:52, 4 November 2013
Installer DNS Server
Install DNS server by download and install the package
apt-get install bind9Configure DNS (Bind9)
First we will edit these 3 files.
- /etc/bind/named.conf.local
 - /etc/bind/named.conf.options
 - /etc/resolvconf/resolv.conf.d/base
 
Second we will create these 2 files.
- /etc/bind/zones/dka.local.db
 - /etc/bind/zones/rev.0.0.10.in-addr.arpa
 
First step: add domain zone – dka.local
Enter the named.conf.local file
nano /etc/bind/named.conf.localAdd the entire to the file
# Our Domain zone
zone "dka.local." {
        type master;
        file "/etc/bind/zones/dka.local.db";
};
# For reverse DNS
zone "0.0.10.in-addr.arpa" {
        type master;
        file "/etc/bind/zones/rev.0.0.10.in-addr.arpa.db";
};Secund step: Add the DNS servers from your ISP
nano /etc/bind/named.conf.options        forwarders {
                172.16.4.66;
         };
        auth-nxdomain no;    # conform to RFC1035
        listen-on-v6 { any; };
        listen-on { any; };
allow-query { 127.0.0.1; 172.16.4.66/24; 10.0.0.0/24;};
};Third step: Modify the resolv.conf file
nano /etc/resolvconf/resolv.conf.d/base
nameserver 10.0.0.1
domain dka.local
search dka.localFourth step: Define zones
mkdir /etc/bind/zones nano /etc/bind/zones/dka.local.db
; BIND data file for local loopback interface
;
$TTL    604800
@       IN      SOA     ns.dka.local. root.dka.local. (
                              8         ; Serial
                         604800         ; Refresh
                          86400         ; Retry
                        2419200         ; Expire
                         604800 )       ; Negative Cache TTL
;
@       IN      NS      ns.dka.local.
ns      IN      A       10.0.0.1
ubuntu  IN      A       10.0.0.21
The TTL or time to live is set for 3 days
The ns.mydomain.com nameserver is defined
ubuntudesktop, pc and gateway are entered as an A record
An alias of www is assigned to ubuntudesktop using CNAME
Step five: Create a “rev.0.0.10.in-addr.arpa” file for reverse lookup
nano /tec/bind/zones/rev.0.0.10.in-addr.arpa
$TTL 3D
@       IN      SOA     ns.dka.local. admin.dka.local. (
                2007062001
                28800
                604800
                604800
                86400
)
        IN      NS      ns.dka.local.
2       IN      PTR     ubuntu.dka.localStep seks: Test vores nye domæne og DNS entries
Dig
$ dig dka.localNslookup
nslookup ns