配置DNS解析SCANIP手册

来源:互联网 发布:java开发常用工具 编辑:程序博客网 时间:2024/05/16 13:07

配置DNS解析SCANIP手册

1 hosts 配置

# public192.168.154.168 orarac1 orarac1.tops.com192.168.154.169 orarac2 orarac2.tops.com#private192.168.10.11 orarac1-priv orarac1-priv.tops.com192.168.10.21 orarac2-priv orarac2-priv.tops.com$vitual192.168.154.111 orarac1-vip orarac1-vip.tops.com192.168.154.121 orarac2-vip orarac2-vip.tops.com

2 编辑文件[root@orarac1 ~]# vi /etc/named.conf
添加DNS服务器实际IP

添加代码块

附上代码

zone "tops.com" IN {type master;file "tops.zone";allow-update {none;};};

3 在var/named 新建文件tops.zone,内容如下
[root@orarac1 named]# cat tops.zone

$TTL 86400@ IN SOA orarac1.tops.com. root.tops.com.(2013042201 ;Serial3600 ;Refresh1800 ;Retry604800 ;Expire86400 ;Minimum TTL)@ IN NS ora-scan.tops.com.ora-scan IN A 192.168.154.68ora-scan IN A 192.168.154.88ora-scan IN A 192.168.154.98

4 [root@orarac1 named]# vi /etc/resolv.conf

5 DNS测试功能

6 常用维护命令

[root@momdb1 named]# chkconfig named on
[root@momdb1 named]# service named restart
Stopping named: [ OK ]
Generating /etc/rndc.key: [ OK ]
Starting named: [ OK ]
[root@momdb1 named]# nslookup ora-scan.tops.com
Server: 10.10.12.161
Address: 10.10.12.161#53

Name: ora-scan.tops.com
Address: 10.10.12.88
Name: ora-scan.tops.com
Address: 10.10.12.98
Name: ora-scan.tops.com
Address: 10.10.12.68

7如果加上反向解析
[root@chd-db01 etc]# vi /etc/named.conf

zone "12.10.10.in-addr.arpa" IN {        type master;        file "fanxiang.zone";        allow-update { none; };};

注意 allow-query参数,要改成any,否则客户端解析报错

8 在/var/named 新增fanxiang.zone,参考下面文件。

$TTL 86400@ IN SOA chd-db01.tops.com. root.tops.com.(2013042201 ;Serial3600 ;Refresh1800 ;Retry604800 ;Expire86400 ;Minimum TTL)@ IN NS momdb-scan.tops.com.165 IN PTR  momdb-scan.tops.com.166 IN PTR  momdb-scan.tops.com.167 IN PTR  momdb-scan.tops.com.161 IN PTR  momdb1.tops.com.162 IN PTR  momdb1.tops.com.

~

9 重启DNS服务,验证系统功能。
[root@momdb2 ~]# nslookup momdb-scan.tops.com
Server: 10.10.12.158
Address: 10.10.12.158#53

Name: momdb-scan.tops.com
Address: 10.10.12.165
Name: momdb-scan.tops.com
Address: 10.10.12.166
Name: momdb-scan.tops.com
Address: 10.10.12.167

[root@momdb2 ~]# nslookup 10.10.12.165
Server: 10.10.12.158
Address: 10.10.12.158#53

165.12.10.10.in-addr.arpa name = momdb-scan.tops.com.

10 客户端配置
[root@momdb2 ~]# vi /etc/resolv.conf

>Generated by NetworkManager >No nameservers found; try putting DNS servers into your> ifcfg files in /etc/sysconfig/network-scripts like so: >DNS1=xxx.xxx.xxx.xxx> DNS2=xxx.xxx.xxx.xxx >DOMAIN=lab.foo.com bar.foo.com*---- search tops.com #不加,可能无法解析域名nameserver 10.10.12.158
0 0
原创粉丝点击