Ajcody-Virtualization-Named-DNS

Ajcody Virtualization Named DNS

   KB 3571        Last updated on 06/21/2016  




0.00
(0 votes)
24px ‎  - This is Zeta Alliance Certified Documentation. The content has been tested by the Community.


Introduction

These can be used as templates for your BIND server to setup a bunch of vmhosts for Zimbra testing. You would either configure the vm hosts to use a static IP address or configure your BIND server to assign them the ip addresses given in this template.

I'm using Centos5 for my BIND server, you might need to adjust paths and so forth for your situation.

Remember to replace DOMAIN with your domain syntax, you might also want to alter the zimbra part as well that I'm using.

Also, please confirm the formating of your copy/paste is correct.

  • My example has BIND running on the host mail3.zimbra.DOMAIN.com and it also runs ZCS for the domains zimbra.DOMAIN.com and mail3.zimbra.DOMAIN.com .
  • domain base is = zimbra.DOMAIN.com
  • hostnames and subdomains being then = HOST.zimbra.DOMAIN.com
  • my example is chroot, so the paths named.conf reflects that with it's path
  • You could also use the BIND specific macro $GENERATE

The BIND Example Configuration Files

BIND Server And named main configuration structure


[root@mail3 named]# hostname
mail3.zimbra.DOMAIN.com

[root@mail3 etc]# pwd
/var/named/chroot/etc

[root@mail3 etc]# ls
db.cache  localtime  named.conf  rndc.key

[root@mail3 etc]# cat named.conf

options {
        directory "/etc";
        pid-file "/var/run/named/named.pid";
        };

zone "." {
        type hint;
        file "/etc/db.cache";
        };
zone "zimbra.DOMAIN.com" {
        type master;
        file "/var/named/zimbra.DOMAIN.com.hosts";
        };
zone "0.168.192.in-addr.arpa" {
        type master;
        file "/var/named/0.168.192.rev";
        };

BIND Zone Files


[root@mail3 named]# pwd
/var/named/chroot/var/named

[root@mail3 named]# ls
0.168.192.rev  data/  slaves/  zimbra.DOMAIN.com.hosts

[root@mail3 named]# cat zimbra.DOMAIN.com.hosts  
                                                                                                          
$ttl 38400
zimbra.DOMAIN.com.    IN      SOA     zimbra.DOMAIN.com. admin.zimbra.DOMAIN.com. (
                        1207910051                
                        10800
                        3600
                        604800
                        38400 )
                                              IN      NS              mail3.zimbra.DOMAIN.com.
zimbra.DOMAIN.com.                            IN      MX      10      mail3.zimbra.DOMAIN.com.

zimbra.DOMAIN.com.                            IN      A               192.168.0.16
_xmpp-client._tcp.zimbra.DOMAIN.com.          SRV     5 0 5222        mail3.zimbra.DOMAIN.com.
_xmpp-server._tcp.zimbra.DOMAIN.com           SRV     5 0 5269        mail3.zimbra.DOMAIN.com.
_jabber._tcp.zimbra.DOMAIN.com.               SRV     5 0 5269        mail3.zimbra.DOMAIN.com.


mail3                           IN      A               192.168.0.16
mail3                           IN      MX      10      mail3       
_xmpp-client._tcp.mail3         SRV     5 0 5222        mail3       
_xmpp-server._tcp.mail3         SRV     5 0 5269        mail3       
_jabber._tcp.mail3              SRV     5 0 5269        mail3       


mail30                          IN      A               192.168.0.30
mail30                          IN      MX      10      mail30      
_xmpp-client._tcp.mail30        SRV     5 0 5222        mail30      
_xmpp-server._tcp.mail30        SRV     5 0 5269        mail30      
_jabber._tcp.mail30             SRV     5 0 5269        mail30      

mail31                          IN      A               192.168.0.31
mail31                          IN      MX      10      mail31      
_xmpp-client._tcp.mail31        SRV     5 0 5222        mail31      
_xmpp-server._tcp.mail31        SRV     5 0 5269        mail31      
_jabber._tcp.mail31             SRV     5 0 5269        mail31      

mail32                          IN      A               192.168.0.32
mail32                          IN      MX      10      mail32      
_xmpp-client._tcp.mail32        SRV     5 0 5222        mail32      
_xmpp-server._tcp.mail32        SRV     5 0 5269        mail32      
_jabber._tcp.mail32             SRV     5 0 5269        mail32      

mail33                          IN      A               192.168.0.33
mail33                          IN      MX      10      mail33      
_xmpp-client._tcp.mail33        SRV     5 0 5222        mail33      
_xmpp-server._tcp.mail33        SRV     5 0 5269        mail33      
_jabber._tcp.mail33             SRV     5 0 5269        mail33      

mail34                          IN      A               192.168.0.34
mail34                          IN      MX      10      mail34      
_xmpp-client._tcp.mail34        SRV     5 0 5222        mail34      
_xmpp-server._tcp.mail34        SRV     5 0 5269        mail34      
_jabber._tcp.mail34             SRV     5 0 5269        mail34      

mail35                          IN      A               192.168.0.35
mail35                          IN      MX      10      mail35      
_xmpp-client._tcp.mail35        SRV     5 0 5222        mail35      
_xmpp-server._tcp.mail35        SRV     5 0 5269        mail35      
_jabber._tcp.mail35             SRV     5 0 5269        mail35      

mail36                          IN      A               192.168.0.36
mail36                          IN      MX      10      mail36      
_xmpp-client._tcp.mail36        SRV     5 0 5222        mail36      
_xmpp-server._tcp.mail36        SRV     5 0 5269        mail36      
_jabber._tcp.mail36             SRV     5 0 5269        mail36      

mail37                          IN      A               192.168.0.37
mail37                          IN      MX      10      mail37      
_xmpp-client._tcp.mail37        SRV     5 0 5222        mail37      
_xmpp-server._tcp.mail37        SRV     5 0 5269        mail37      
_jabber._tcp.mail37             SRV     5 0 5269        mail37      

mail38                          IN      A               192.168.0.38
mail38                          IN      MX      10      mail38      
_xmpp-client._tcp.mail38        SRV     5 0 5222        mail38      
_xmpp-server._tcp.mail38        SRV     5 0 5269        mail38      
_jabber._tcp.mail38             SRV     5 0 5269        mail38      

mail39                          IN      A               192.168.0.39
mail39                          IN      MX      10      mail39      
_xmpp-client._tcp.mail39        SRV     5 0 5222        mail39      
_xmpp-server._tcp.mail39        SRV     5 0 5269        mail39      
_jabber._tcp.mail39             SRV     5 0 5269        mail39      

mail40                          IN      A               192.168.0.40
mail40                          IN      MX      10      mail40      
_xmpp-client._tcp.mail40        SRV     5 0 5222        mail40      
_xmpp-server._tcp.mail40        SRV     5 0 5269        mail40      
_jabber._tcp.mail40             SRV     5 0 5269        mail40      

mail41                          IN      A               192.168.0.41
mail41                          IN      MX      10      mail41      
_xmpp-client._tcp.mail41        SRV     5 0 5222        mail41      
_xmpp-server._tcp.mail41        SRV     5 0 5269        mail41      
_jabber._tcp.mail41             SRV     5 0 5269        mail41      

mail42                          IN      A               192.168.0.42
mail42                          IN      MX      10      mail42      
_xmpp-client._tcp.mail42        SRV     5 0 5222        mail42      
_xmpp-server._tcp.mail42        SRV     5 0 5269        mail42      
_jabber._tcp.mail42             SRV     5 0 5269        mail42      

mail43                          IN      A               192.168.0.43
mail43                          IN      MX      10      mail43      
_xmpp-client._tcp.mail43        SRV     5 0 5222        mail43      
_xmpp-server._tcp.mail43        SRV     5 0 5269        mail43      
_jabber._tcp.mail43             SRV     5 0 5269        mail43      

mail44                          IN      A               192.168.0.44
mail44                          IN      MX      10      mail44      
_xmpp-client._tcp.mail44        SRV     5 0 5222        mail44      
_xmpp-server._tcp.mail44        SRV     5 0 5269        mail44      
_jabber._tcp.mail44             SRV     5 0 5269        mail44      

mail45                          IN      A               192.168.0.45
mail45                          IN      MX      10      mail45      
_xmpp-client._tcp.mail45        SRV     5 0 5222        mail45      
_xmpp-server._tcp.mail45        SRV     5 0 5269        mail45      
_jabber._tcp.mail45             SRV     5 0 5269        mail45      

mail46                          IN      A               192.168.0.46
mail46                          IN      MX      10      mail46      
_xmpp-client._tcp.mail46        SRV     5 0 5222        mail46      
_xmpp-server._tcp.mail46        SRV     5 0 5269        mail46      
_jabber._tcp.mail46             SRV     5 0 5269        mail46      

mail47                          IN      A               192.168.0.47
mail47                          IN      MX      10      mail47      
_xmpp-client._tcp.mail47        SRV     5 0 5222        mail47      
_xmpp-server._tcp.mail47        SRV     5 0 5269        mail47      
_jabber._tcp.mail47             SRV     5 0 5269        mail47      

mail48                          IN      A               192.168.0.48
mail48                          IN      MX      10      mail48      
_xmpp-client._tcp.mail48        SRV     5 0 5222        mail48      
_xmpp-server._tcp.mail48        SRV     5 0 5269        mail48      
_jabber._tcp.mail48             SRV     5 0 5269        mail48      

mail49                          IN      A               192.168.0.49
mail49                          IN      MX      10      mail49      
_xmpp-client._tcp.mail49        SRV     5 0 5222        mail49      
_xmpp-server._tcp.mail49        SRV     5 0 5269        mail49      
_jabber._tcp.mail49             SRV     5 0 5269        mail49

mail50                          IN      A               192.168.0.50
mail50                          IN      MX      10      mail50
_xmpp-client._tcp.mail50        SRV     5 0 5222        mail50
_xmpp-server._tcp.mail50        SRV     5 0 5269        mail50
_jabber._tcp.mail50             SRV     5 0 5269        mail50

mail51                          IN      A               192.168.0.51
mail51                          IN      MX      10      mail51
_xmpp-client._tcp.mail51        SRV     5 0 5222        mail51
_xmpp-server._tcp.mail51        SRV     5 0 5269        mail51
_jabber._tcp.mail51             SRV     5 0 5269        mail51

mail52                          IN      A               192.168.0.52
mail52                          IN      MX      10      mail52
_xmpp-client._tcp.mail52        SRV     5 0 5222        mail52
_xmpp-server._tcp.mail52        SRV     5 0 5269        mail52
_jabber._tcp.mail52             SRV     5 0 5269        mail52

mail53                          IN      A               192.168.0.53
mail53                          IN      MX      10      mail53
_xmpp-client._tcp.mail53        SRV     5 0 5222        mail53
_xmpp-server._tcp.mail53        SRV     5 0 5269        mail53
_jabber._tcp.mail53             SRV     5 0 5269        mail53

mail54                          IN      A               192.168.0.54
mail54                          IN      MX      10      mail54
_xmpp-client._tcp.mail54        SRV     5 0 5222        mail54
_xmpp-server._tcp.mail54        SRV     5 0 5269        mail54
_jabber._tcp.mail54             SRV     5 0 5269        mail54

mail55                          IN      A               192.168.0.55
mail55                          IN      MX      10      mail55
_xmpp-client._tcp.mail55        SRV     5 0 5222        mail55
_xmpp-server._tcp.mail55        SRV     5 0 5269        mail55
_jabber._tcp.mail55             SRV     5 0 5269        mail55

mail56                          IN      A               192.168.0.56
mail56                          IN      MX      10      mail56
_xmpp-client._tcp.mail56        SRV     5 0 5222        mail56
_xmpp-server._tcp.mail56        SRV     5 0 5269        mail56
_jabber._tcp.mail56             SRV     5 0 5269        mail56

mail57                          IN      A               192.168.0.57
mail57                          IN      MX      10      mail57
_xmpp-client._tcp.mail57        SRV     5 0 5222        mail57
_xmpp-server._tcp.mail57        SRV     5 0 5269        mail57
_jabber._tcp.mail57             SRV     5 0 5269        mail57

mail58                          IN      A               192.168.0.58
mail58                          IN      MX      10      mail58
_xmpp-client._tcp.mail58        SRV     5 0 5222        mail58
_xmpp-server._tcp.mail58        SRV     5 0 5269        mail58
_jabber._tcp.mail58             SRV     5 0 5269        mail58

mail59                          IN      A               192.168.0.59
mail59                          IN      MX      10      mail59
_xmpp-client._tcp.mail59        SRV     5 0 5222        mail59
_xmpp-server._tcp.mail59        SRV     5 0 5269        mail59
_jabber._tcp.mail59             SRV     5 0 5269        mail59

mail60                          IN      A               192.168.0.60
mail60                          IN      MX      10      mail60
_xmpp-client._tcp.mail60        SRV     5 0 5222        mail60
_xmpp-server._tcp.mail60        SRV     5 0 5269        mail60
_jabber._tcp.mail60             SRV     5 0 5269        mail60

mail61                          IN      A               192.168.0.61
mail61                          IN      MX      10      mail61
_xmpp-client._tcp.mail61        SRV     5 0 5222        mail61
_xmpp-server._tcp.mail61        SRV     5 0 5269        mail61
_jabber._tcp.mail61             SRV     5 0 5269        mail61

mail62                          IN      A               192.168.0.62
mail62                          IN      MX      10      mail62
_xmpp-client._tcp.mail62        SRV     5 0 5222        mail62
_xmpp-server._tcp.mail62        SRV     5 0 5269        mail62
_jabber._tcp.mail62             SRV     5 0 5269        mail62

mail63                          IN      A               192.168.0.63
mail63                          IN      MX      10      mail63
_xmpp-client._tcp.mail63        SRV     5 0 5222        mail63
_xmpp-server._tcp.mail63        SRV     5 0 5269        mail63
_jabber._tcp.mail63             SRV     5 0 5269        mail63

mail64                          IN      A               192.168.0.64
mail64                          IN      MX      10      mail64
_xmpp-client._tcp.mail64        SRV     5 0 5222        mail64
_xmpp-server._tcp.mail64        SRV     5 0 5269        mail64
_jabber._tcp.mail64             SRV     5 0 5269        mail64

mail65                          IN      A               192.168.0.65
mail65                          IN      MX      10      mail65
_xmpp-client._tcp.mail65        SRV     5 0 5222        mail65
_xmpp-server._tcp.mail65        SRV     5 0 5269        mail65
_jabber._tcp.mail65             SRV     5 0 5269        mail65

mail66                          IN      A               192.168.0.66
mail66                          IN      MX      10      mail66
_xmpp-client._tcp.mail66        SRV     5 0 5222        mail66
_xmpp-server._tcp.mail66        SRV     5 0 5269        mail66
_jabber._tcp.mail66             SRV     5 0 5269        mail66

mail67                          IN      A               192.168.0.67
mail67                          IN      MX      10      mail67
_xmpp-client._tcp.mail67        SRV     5 0 5222        mail67
_xmpp-server._tcp.mail67        SRV     5 0 5269        mail67
_jabber._tcp.mail67             SRV     5 0 5269        mail67

mail68                          IN      A               192.168.0.68
mail68                          IN      MX      10      mail68
_xmpp-client._tcp.mail68        SRV     5 0 5222        mail68
_xmpp-server._tcp.mail68        SRV     5 0 5269        mail68
_jabber._tcp.mail68             SRV     5 0 5269        mail68

mail69                          IN      A               192.168.0.69
mail69                          IN      MX      10      mail69
_xmpp-client._tcp.mail69        SRV     5 0 5222        mail69
_xmpp-server._tcp.mail69        SRV     5 0 5269        mail69
_jabber._tcp.mail69             SRV     5 0 5269        mail69


[root@mail3 named]# cat 0.168.192.rev
$ttl 38400
$ORIGIN 0.168.192.in-addr.arpa.
@       IN      SOA     mail3.zimbra.DOMAIN.com. admin.mail3.DOMAIN.com. (
                        1207910558
                        10800
                        3600
                        604800
                        38400 )
                                IN      NS      mail3.zimbra.DOMAIN.com.

16                              IN      PTR     mail3.zimbra.DOMAIN.com.
16                              IN      PTR     zimbra.DOMAIN.com.

30                              IN      PTR     mail30.zimbra.DOMAIN.com.
31                              IN      PTR     mail31.zimbra.DOMAIN.com.
32                              IN      PTR     mail32.zimbra.DOMAIN.com.
33                              IN      PTR     mail33.zimbra.DOMAIN.com.
34                              IN      PTR     mail34.zimbra.DOMAIN.com.
35                              IN      PTR     mail35.zimbra.DOMAIN.com.
36                              IN      PTR     mail36.zimbra.DOMAIN.com.
37                              IN      PTR     mail37.zimbra.DOMAIN.com.
38                              IN      PTR     mail38.zimbra.DOMAIN.com.
39                              IN      PTR     mail39.zimbra.DOMAIN.com.
40                              IN      PTR     mail40.zimbra.DOMAIN.com.
41                              IN      PTR     mail41.zimbra.DOMAIN.com.
42                              IN      PTR     mail42.zimbra.DOMAIN.com.
43                              IN      PTR     mail43.zimbra.DOMAIN.com.
44                              IN      PTR     mail44.zimbra.DOMAIN.com.
45                              IN      PTR     mail45.zimbra.DOMAIN.com.
46                              IN      PTR     mail46.zimbra.DOMAIN.com.
47                              IN      PTR     mail47.zimbra.DOMAIN.com.
48                              IN      PTR     mail48.zimbra.DOMAIN.com.
49                              IN      PTR     mail49.zimbra.DOMAIN.com.
50                              IN      PTR     mail50.zimbra.DOMAIN.com.
51                              IN      PTR     mail51.zimbra.DOMAIN.com.
52                              IN      PTR     mail52.zimbra.DOMAIN.com.
53                              IN      PTR     mail53.zimbra.DOMAIN.com.
54                              IN      PTR     mail54.zimbra.DOMAIN.com.
55                              IN      PTR     mail55.zimbra.DOMAIN.com.
56                              IN      PTR     mail56.zimbra.DOMAIN.com.
57                              IN      PTR     mail57.zimbra.DOMAIN.com.
58                              IN      PTR     mail58.zimbra.DOMAIN.com.
59                              IN      PTR     mail59.zimbra.DOMAIN.com.
60                              IN      PTR     mail60.zimbra.DOMAIN.com.
61                              IN      PTR     mail61.zimbra.DOMAIN.com.
62                              IN      PTR     mail62.zimbra.DOMAIN.com.
63                              IN      PTR     mail63.zimbra.DOMAIN.com.
64                              IN      PTR     mail64.zimbra.DOMAIN.com.
65                              IN      PTR     mail65.zimbra.DOMAIN.com.
66                              IN      PTR     mail66.zimbra.DOMAIN.com.
67                              IN      PTR     mail67.zimbra.DOMAIN.com.
68                              IN      PTR     mail68.zimbra.DOMAIN.com.
69                              IN      PTR     mail69.zimbra.DOMAIN.com.

The Results

You should then get returns like the following for the hosts you setup. Remember, mail3.zimbra.DOMAIN.com is my BIND server which uses 192.168.0.16 .


[root@mail3 named]# host -a mail50.zimbra.DOMAIN.com

Trying "mail50.zimbra.DOMAIN.com"
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 59395
;; flags: qr aa rd ra; QUERY: 1, ANSWER: 2, AUTHORITY: 1, ADDITIONAL: 1

;; QUESTION SECTION:
;mail50.zimbra.DOMAIN.com.    IN      ANY

;; ANSWER SECTION:
mail50.zimbra.DOMAIN.com. 38400 IN    A       192.168.0.50
mail50.zimbra.DOMAIN.com. 38400 IN    MX      10 mail50.zimbra.DOMAIN.com.

;; AUTHORITY SECTION:
zimbra.DOMAIN.com.    38400   IN      NS      mail3.zimbra.DOMAIN.com.

;; ADDITIONAL SECTION:
mail3.zimbra.DOMAIN.com. 38400 IN     A       192.168.0.16

Received 112 bytes from 192.168.0.16#53 in 3 ms


[root@mail3 named]# host 192.168.0.50

50.0.168.192.in-addr.arpa domain name pointer mail50.zimbra.DOMAIN.com.


Jump to: navigation, search