Ubuntu server 12.04/dns

From Attie's Wiki
(Difference between revisions)
Jump to: navigation, search
m
m
Line 22: Line 22:
 
</source>
 
</source>
  
Which contains one line per zone:
+
<code>/etc/bind/named.conf.zones</code> contains one line per zone:
 
<source lang="text">
 
<source lang="text">
zone "attie.co.uk"     { type master; file "/etc/bind/zones/attie.co.uk"; };
+
zone "attie.co.uk" in { type master; file "/etc/bind/zones/attie.co.uk"; notify yes; };
 
</source>
 
</source>
  
Zone configs are stored in <code>/etc/bind/zones</code>.
+
Zone configs are stored in <code>/etc/bind/zones/</code>. E.g:
E.g:
+
 
<source lang="text">
 
<source lang="text">
 
$TTL    604800
 
$TTL    604800
Line 70: Line 69:
 
git                    CNAME  attie.co.uk.
 
git                    CNAME  attie.co.uk.
 
svn                    CNAME  attie.co.uk.
 
svn                    CNAME  attie.co.uk.
 
new                    CNAME  attie.co.uk.
 
 
test                    CNAME  attie.co.uk.
 
*.test                  CNAME  attie.co.uk.
 
  
 
;####################################################
 
;####################################################

Revision as of 21:50, 3 May 2012

apt-get install bind9 dnsutils

Control The Server

Service control:

service bind9 restart

Check the config (it just fails with no error message if you get it wrong):

named-checkconf

Configure the Server

Config files are in /etc/bind.

I have added the following line to /etc/bind/named.conf:

include "/etc/bind/named.conf.zones";

/etc/bind/named.conf.zones contains one line per zone:

zone "attie.co.uk" in { type master; file "/etc/bind/zones/attie.co.uk"; notify yes; };

Zone configs are stored in /etc/bind/zones/. E.g:

$TTL    604800
 
;####################################################
; domain configuration
@       IN      SOA     akela.attie.co.uk.      ; primary NS
                        attie@attie.co.uk. (    ; hostmaster email
                              2                 ; Serial
                         604800                 ; Refresh
                          86400                 ; Retry
                        2419200                 ; Expire
                         604800 )               ; Negative Cache TTL
 
@                       NS      akela.attie.co.uk.
 
;####################################################
; mail
@                       MX 1    aspmx.l.google.com.
@                       MX 5    alt1.aspmx.l.google.com.
@                       MX 5    alt2.aspmx.l.google.com.
@                       MX 10   aspmx2.googlemail.com.
@                       MX 10   aspmx3.googlemail.com.
@                       MX 10   aspmx4.googlemail.com.
@                       MX 10   aspmx5.googlemail.com.
 
@                       TXT     v=spf1 a mx ~all
 
;####################################################
; aliases
@                       A       192.168.0.251
www                     CNAME   attie.co.uk.
 
mail                    CNAME   ghs.google.com.
 
libxbee                 CNAME   attie.co.uk.
doc.libxbee             CNAME   attie.co.uk.
 
cgi                     CNAME   attie.co.uk.
wiki                    CNAME   attie.co.uk.
git                     CNAME   attie.co.uk.
svn                     CNAME   attie.co.uk.
 
;####################################################
; physical machines
akela                   CNAME   attie.co.uk.
baloo                   A       192.168.0.1
Personal tools
Namespaces

Variants
Actions
Navigation
Toolbox