Amazon Web Services - AWS EC2 - Ubuntu 14.04

Bind config files

When creating new DNS zone file do the following:

1. create zone file (if domain server nameservers)

# vim /etc/bind/db.domain.com

$ORIGIN mikosoft.net. ;;; call $ORIGIN variable with @
$TTL 14400
@    86400    IN    SOA    ns1.mikosoft.net.    info.mikosoft.net.    (
                        2014062400 ;Serial Number
                        86400 ;refresh
                        7200 ;retry
                        86400 ;expire
                        86400 ;minimum
)

@    86400    IN    NS    ns1.mikosoft.net.
@    86400    IN    NS    ns2.mikosoft.net.

@    14400    IN    A    52.28.170.2

@    14400    IN    MX    10 mail

@ IN TXT "v=spf1 a"
@ IN SPF "v=spf1 a"


www             14400    IN    A    52.28.170.2

mail            14400    IN    A    52.28.170.2
ftp             14400    IN    A    52.28.170.2

ns1             14400    IN    A    52.28.170.2
ns2             14400    IN    A    52.28.170.2
vps             14400    IN    A    52.28.170.2

default._domainkey      IN      TXT     ( "v=DKIM1; k=rsa; "
          "p=MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQDQfuLTW3Pc7SrXzyOk9YUKeLacXdVmBS9QBzjPbMuY+MnSNXPKV8hJ+dH5eQmWxWA7Ak/jRyiRUXfZxHfl3JJqgddCSJDaeS/lnuej9sFbE2U66hlBaXO/au8iQlTeCJZCs5FnSqJyaL82ddOX0zWrrkpqr9FDs6d1473/wCgc/QIDAQAB" )  ; ----- DKIM key default for mikosoft.net

 

1. create zone file (for ordinary domain - no serving dns servers)

$ORIGIN brvno.com. ;;; call $ORIGIN variable with @
$TTL 14400
@    86400    IN    SOA    ns1.mikosoft.net.    info.mikosoft.net.    (
                        2015062500 ;Serial Number
                        86400 ;refresh
                        7200 ;retry
                        86400 ;expire
                        86400 ;minimum
)

@    86400    IN    NS    ns1.mikosoft.net.
@    86400    IN    NS    ns2.mikosoft.net.

@    14400    IN    A    52.28.170.2

@    14400    IN    MX    10 mail

@ IN TXT "v=spf1 a"
@ IN SPF "v=spf1 a"


www             14400    IN    A    52.28.170.2

mail            14400    IN    A    52.28.170.2
ftp             14400    IN    A    52.28.170.2

 

2. register zone (add lines into file)

# vim /etc/bind/named.conf.default-zones

zone "mikosoft.net" {
    type master;
    file "/etc/bind/db.mikosoft.net";
};

 

3. permissions and ownerships must be

# ls -al /etc/bind

-rw-r--r--   1 root root 2389 Feb 18 14:45 bind.keys
-rw-r--r--   1 root root  237 Feb 18 14:45 db.0
-rw-r--r--   1 root root  271 Feb 18 14:45 db.127
-rw-r--r--   1 root root  237 Feb 18 14:45 db.255
-rw-r--r--   1 root bind  689 Jun 29 11:19 db.brvno.com
-rw-r--r--   1 root bind 1002 Jun 29 11:16 db.edrvo.com
-rw-r--r--   1 root root  353 Feb 18 14:45 db.empty
-rw-r--r--   1 root bind  977 Jun 29 11:19 db.i-oglasi.com
-rw-r--r--   1 root root  270 Feb 18 14:45 db.local
-rw-r--r--   1 root bind 1092 Jun 29 11:18 db.mikosoft.net
-rw-r--r--   1 root bind  433 Jun 29 19:13 db.reverse
-rw-r--r--   1 root root 3048 Feb 18 14:45 db.root
-rw-r--r--   1 root bind  463 Jun 29 19:04 named.conf
-rw-r--r--   1 root bind  544 Jun 29 12:13 named.conf.default-zones
-rw-r--r--   1 root bind  800 Jun 29 11:51 named.conf.default-zones.orig
-rw-r--r--   1 root bind  165 Feb 18 14:45 named.conf.local
-rw-r--r--   1 root bind  890 Jun 29 19:03 named.conf.options
-rw-r--r--   1 bind bind   77 Jun 24 18:08 rndc.key
-rw-r--r--   1 root root 1317 Feb 18 14:45 zones.rfc1918