centos 7.6 dns配置

1、安装
yum install -y bind
yum install -y bind-libs

2、vi /etc/named.conf
改3处
listen-on port 53 { any;};
listen-on-v6 port 53 { any; };

allow-query { any; };
3、 vi /var/named/gengpx.com.zone

$TTL 1D
@ IN SOA @ root.gengpx.com. (
0 ; serial
1D ; refresh
1H ; retry
1W ; expire
3H ) ; minimum
NS @
A 192.168.1.199 ;gengpx.com的ip为192.168.1.199
www A 192.168.1.199 ;www.gengpx.com的ip解析为192.168.1.199
@ MX 10 mx.gengpx.com. ;gengpx.com的mx记录为mx.gengpx.com
AAAA ::1

4、启动服务
systemctl start named
5、测试
ping www.gengpx.com -c 5
ping gengp.com -c 5
nslookup www.gengpx.com

你可能感兴趣的:(centos 7.6 dns配置)