配置DNS解析SCANIP手册

配置DNS解析SCANIP手册

1 hosts 配置

# public
192.168.154.168 orarac1 orarac1.tops.com
192.168.154.169 orarac2 orarac2.tops.com

#private
192.168.10.11 orarac1-priv orarac1-priv.tops.com
192.168.10.21 orarac2-priv orarac2-priv.tops.com

$vitual
192.168.154.111 orarac1-vip orarac1-vip.tops.com
192.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 ;Serial
3600 ;Refresh
1800 ;Retry
604800 ;Expire
86400 ;Minimum TTL
)
@ IN NS ora-scan.tops.com.
ora-scan IN A 192.168.154.68
ora-scan IN A 192.168.154.88
ora-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 ;Serial
3600 ;Refresh
1800 ;Retry
604800 ;Expire
86400 ;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
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值