Linux DNS 配置示例

We want to configure for this server:
IP: 192.168.1.5
Server: host.com, mail.host.com

1.1     Modify /etc/named.conf

Added this to /etc/named.conf
zone "host.com" IN    {
            type master;
            file "host.com.zone";
            allow-update {none;};
};
So this file will be:
[[email protected] data]# cat /etc/named.conf
// Default named.conf generated by install of bind-9.2.4-24.EL4
options {
                directory "/var/named";
                dump-file "/var/named/data/cache_dump.db";
                statistics-file "/var/named/data/named_stats.txt";
};
include "/etc/rndc.key";
zone "host.com" IN    {
            type master;
            file "host.com.zone";
            allow-update {none;};
};
 

1.2     Create file /var/named/host.com.zone

Create host.com.zone file in /var/named:
[root@host named]# vi /var/named/host.com.zone    
$TTL 86400    
@ IN SOA host.com. root.host.com. (    
    3 ; serial    
    28800 ; refresh    
    7200 ; retry    
    604800 ; expire    
    86400 ; ttl    
                        )    

@ IN NS host.com.    

@ IN MX 20 host.com.    
@ IN MX 30 mail.host.com.    

www IN A 192.168.1.5    
mail IN A 192.168.1.5    
* IN A 192.168.1.5
 

1.3     Add these content to /etc/resolv.conf

domain host.com
nameserver 192.168.1.5
 

1.4   Restart Named service

[root@host named]# service named restart
Stopping named:                                                                                        [    OK    ]
Starting named:                                                                                        [    OK    ]

你可能感兴趣的:(linux,职场,dns,示例,休闲)