Red Hat Enterprise Linux AS3 BIND

类别:软件工程 点击:0 评论:0 推荐:
Red Hat Enterprise Linux AS3 中dns server的配置--字符界面
Red Hat Enterprise Linux AS3 中dns server的配置--字符界面
1.所需配置文件
/etc/named.conf---------系统自带,需要配置
/etc/resolv.conf----------系统自带,需要配置
/var/named/supermaster.com.zone---------系统没有,需要创建配置
/var/named/0.168.192.in-arpa.zone--------系统没有,需要创建配置
/var/named/named.local------------------------系统自带,不需修改
/var/named/named.ca--------------------------系统自带,不需修改

2.配置方案
2.1、/etc/named.conf
说明:DNS主配置文件,定义了域数据库信息的基本参数和源点,该文件可以存放在本地或远程的服务器上。源文件如下:
      
## named.conf - configuration for bind
#
# Generated automatically by redhat-config-bind, alchemist et al.
# Any changes not supported by redhat-config-bind should be put
# in /etc/named.custom
#
controls {
        inet 127.0.0.1 allow { localhost; } keys { rndckey; };
};

include "/etc/named.custom";

include "/etc/rndc.key";

zone  "0.0.127.in-addr.arpa" {
type master;
file  "0.0.127.in-addr.arpa.zone";
};
zone  "0.168.192.in-addr.arpa" {
type master;
file  "0.168.192.in-addr.arpa.zone";
};


zone  "localhost" {
type master;
file  "localhost.zone";
};
zone  "supermaster.com" {
type master;
file  "supermaster.com.zone";
};



    
2.2、/var/named/supermaster.com.zone
说明:正向解析配置文件,即实现name2ip的对应,源文件如下:

$TTL 86400
@ IN SOA dns.supermaster.com.  root.localhost (
   2 ; serial
   28800 ; refresh
   7200 ; retry
   604800 ; expire
   86400 ; ttl
   )


IN NS dns.

mail IN MX 1 mail

dns IN A 192.168.0.100
www IN A 192.168.0.100
ftp IN A 192.168.0.100
mail IN A 192.168.0.100


2.3、/var/named/0.168.192.in-arpa.zone
说明:DNS反向解析配置文件,即实现IP2name的对应,源文件如下:

$TTL 86400
@ IN SOA dns.supermaster.com. root.localhost (
   7 ; serial
   28800 ; refresh
   7200 ; retry
   604800 ; expire
   86400 ; ttk
   )


@ IN NS dns.
@ IN NS ftp.
@ IN NS mail.
@ IN NS www.

100 IN PTR redhat.supermaster.com.


2.4、/etc/resolv.conf
说明:指定域名服务器的IP和搜索顺序,源文件如下:
search supermaster.com
nameserver 192.168.0.100


3.测试及管理办法
3.1、修改完DNS的配置文件,需要重新启动named,输入:named -u named
来使更改的配置生效
3.2、nslookup测试正向解析、反向解析是否正常。如下:
A:正向解析
[root@redhat root]# redhat-config-bind
[root@redhat root]# nslookup -sil www.supermaster.com
Server:         192.168.0.100
Address:        192.168.0.100#53

Name:   www.supermaster.com
Address: 192.168.0.100

B:反向解析
[root@redhat root]# nslookup -sil 192.168.0.100
Server:         192.168.0.100
Address:        192.168.0.100#53

100.0.168.192.in-addr.arpa      name = redhat.supermaster.com.

到此DNS服务器已经正确设置了,大家可以看到53端口已经在运行了

[root@redhat root]#netstat –nl

Active Internet connections (only servers)
Proto Recv-Q Send-Q Local Address           Foreign Address         State      
tcp        0      0 0.0.0.0:32768           0.0.0.0:*               LISTEN      
tcp        0      0 127.0.0.1:32769         0.0.0.0:*               LISTEN      
tcp        0      0 0.0.0.0:513             0.0.0.0:*               LISTEN      
tcp        0      0 0.0.0.0:199             0.0.0.0:*               LISTEN      
tcp        0      0 0.0.0.0:139             0.0.0.0:*               LISTEN      
tcp        0      0 0.0.0.0:110             0.0.0.0:*               LISTEN      
tcp        0      0 127.0.0.1:783           0.0.0.0:*               LISTEN      
tcp        0      0 0.0.0.0:111             0.0.0.0:*               LISTEN      
tcp        0      0 0.0.0.0:6000            0.0.0.0:*               LISTEN      
tcp        0      0 0.0.0.0:80              0.0.0.0:*               LISTEN      
tcp        0      0 192.168.0.200:53        0.0.0.0:*               LISTEN      
tcp        0      0 192.168.0.100:53        0.0.0.0:*               LISTEN      
tcp        0      0 127.0.0.1:53            0.0.0.0:*               LISTEN      
tcp        0      0 0.0.0.0:22              0.0.0.0:*               LISTEN      
tcp        0      0 127.0.0.1:631           0.0.0.0:*               LISTEN      
tcp        0      0 0.0.0.0:23              0.0.0.0:*               LISTEN      
tcp        0      0 127.0.0.1:25            0.0.0.0:*               LISTEN      
tcp        0      0 127.0.0.1:953           0.0.0.0:*               LISTEN      
tcp        0      0 0.0.0.0:443             0.0.0.0:*               LISTEN      
udp        0      0 0.0.0.0:32768           0.0.0.0:*                          
udp        0      0 0.0.0.0:32769           0.0.0.0:*                          
udp        0      0 192.168.0.100:137       0.0.0.0:*                          
udp        0      0 192.168.0.200:137       0.0.0.0:*                          
udp        0      0 0.0.0.0:137             0.0.0.0:*                          
udp        0      0 192.168.0.100:138       0.0.0.0:*                          
udp        0      0 192.168.0.200:138       0.0.0.0:*                          
udp        0      0 0.0.0.0:138             0.0.0.0:*                          
udp        0      0 0.0.0.0:161             0.0.0.0:*                          
udp        0      0 192.168.0.200:53        0.0.0.0:*                          
udp        0      0 192.168.0.100:53        0.0.0.0:*                          
udp        0      0 127.0.0.1:53            0.0.0.0:*                          
udp        0      0 0.0.0.0:971             0.0.0.0:*                          
udp        0      0 0.0.0.0:111             0.0.0.0:*                          
udp        0      0 0.0.0.0:631             0.0.0.0:*                          
Active UNIX domain sockets (only servers)
Proto RefCnt Flags       Type       State         I-Node Path
unix  2      [ ACC ]     STREAM     LISTENING     4143   /tmp/.iroha_unix/IROHA
unix  2      [ ACC ]     STREAM     LISTENING     4524   /tmp/orbit-root/linc-107c-0-6da93039271fb
unix  2      [ ACC ]     STREAM     LISTENING     4532   /tmp/orbit-root/linc-103a-0-45f89c834871
unix  2      [ ACC ]     STREAM     LISTENING     4653   /tmp/orbit-root/linc-107e-0-118e9afae4966
unix  2      [ ACC ]     STREAM     LISTENING     4759   /tmp/orbit-root/linc-108c-0-2157bc9d77dec
unix  2      [ ACC ]     STREAM     LISTENING     4674   /tmp/orbit-root/linc-1080-0-56cb44bb2d663
unix  2      [ ACC ]     STREAM     LISTENING     4787   /tmp/orbit-root/linc-1094-0-4d56fc411de59
unix  2      [ ACC ]     STREAM     LISTENING     4805   /tmp/orbit-root/linc-1090-0-4d56fc414ea35
unix  2      [ ACC ]     STREAM     LISTENING     4828   /tmp/orbit-root/linc-1092-0-4d56fc41eccb2
unix  2      [ ACC ]     STREAM     LISTENING     4847   /tmp/orbit-root/linc-1097-0-1f5fdba327c14
unix  2      [ ACC ]     STREAM     LISTENING     7481   /tmp/orbit-root/linc-1149-0-79c2a8f4ecc58
unix  2      [ ACC ]     STREAM     LISTENING     4102   /dev/gpmctl
unix  2      [ ACC ]     STREAM     LISTENING     4998   /tmp/orbit-root/linc-109b-0-5eaeb1612bfb6
unix  2      [ ACC ]     STREAM     LISTENING     4965   /tmp/orbit-root/linc-10a1-0-3a3a5148891f1
unix  2      [ ACC ]     STREAM     LISTENING     4399   /tmp/.gdm_socket
unix  2      [ ACC ]     STREAM     LISTENING     4690   /tmp/.fam_socket
unix  2      [ ACC ]     STREAM     LISTENING     4276   /tmp/.font-unix/fs7100
unix  2      [ ACC ]     STREAM     LISTENING     4495   /tmp/ssh-XXeHbqHv/agent.4154
unix  2      [ ACC ]     STREAM     LISTENING     4643   /tmp/.ICE-unix/4154
unix  2      [ ACC ]     STREAM     LISTENING     4409   /tmp/.X11-unix/X0

本文地址:http://com.8s8s.com/it/it33928.htm