DNS 搭建

拓扑图
DNS 搭建_第1张图片
1、配置yum
[rhel]
name=rhel
baseurl=file:///mnt/Server
enabled=1
gpgcheck=0
2、安装软件
[root@localhost named]# yum install -y bind* caching-nameserver 
3、设置配置文件
[root@localhost etc]# cat named.conf
options {
 directory "/var/named";
};
zone "shareclouds.com" IN{
 type master;
 file "shareclouds.com.zone";
};
zone "51.10.10.in-addr.arpa" {
 type master;
 file "shareclouds.com.10.10.51";
};
[root@localhost etc]# cd ../var/named/
[root@localhost named]# cat shareclouds.com.zone
$TTL 86400     
shareclouds.com.  IN SOA   sharelcouds.com. root.sharelcouds.com. ( 
                                     42 ; serial (d. adams)
                                     3H ; refresh
                                     15M ; retry
                                     1W ; expiry
                                     1D ) ; minimum
                   IN NS shareclouds.com.
www           IN A 10.10.51.61
portal         IN A 10.10.51.11
gateway     IN A 10.10.51.12
router         IN A 10.10.51.13
replay         IN A 10.10.51.14
                   IN A 127.0.0.1
                   IN AAAA ::1
[root@localhost named]# cat shareclouds.com.10.10.51
$TTL 86400
@ IN SOA @ root (
                                      42 ; Serial
                                      3H ; Refresh
                                      15M ; Retry
                                      1W ; Expire
                                      1D ) ; Minimum
@ IN NS shareclouds.com.
61 IN PTR www.shareclouds.com.
11 IN PTR portal.shareclouds.com.
12 IN PTR gateway.shareclouds.com.
13 IN PTR router.shareclouds.com.
14 IN PTR replay.shareclouds.com.
3、配置dns地址
[root@localhost named]# cat /etc/resolv.conf
search localhost
nameserver 10.10.51.61
4、测试配置结果
[root@localhost named]# host portal.shareclouds.com
portal.shareclouds.com has address 10.10.51.11

[root@localhost named]# host 10.10.51.11
11.51.10.10.in-addr.arpa domain name pointer portal.shareclouds.com.

[root@localhost named]# nslookup portal.shareclouds.com
Server: 10.10.51.61
Address: 10.10.51.61#53
Name: portal.shareclouds.com
Address: 10.10.51.11

你可能感兴趣的:(linux,linux,DNS搭建)