linux dns服务

[root@rhel7 ~]# yum install unbound

[root@rhel7 ~]# systemctl start unbound

[root@rhel7 ~]# systemctl enable unbound

[root@rhel7 ~]# firewall-cmd --permanent --add-service=dns
success
[root@rhel7 ~]# netstat -antulp | grep unbound
tcp 0 0 127.0.0.1:8953 0.0.0.0:* LISTEN 3058/unbound
tcp 0 0 127.0.0.1:53 0.0.0.0:* LISTEN 3058/unbound
tcp6 0 0 ::1:8953 :::* LISTEN 3058/unbound
tcp6 0 0 ::1:53 :::* LISTEN 3058/unbound
udp 0 0 127.0.0.1:53 0.0.0.0:* 3058/unbound
udp6 0 0 ::1:53 :::* 3058/unbound

[root@rhel7 /]# vi /etc/unbound/unbound.conf

interface: 0.0.0.0 #去掉注释

access-control: 0.0.0.0/0 allow #去掉注释,refuse改为allow

username: "" #去掉用户名unbound,改为空

[root@rhel7 /]# systemctl restart unbound

[root@rhel7 /]# netstat -antulp | grep unbound
tcp 0 0 127.0.0.1:8953 0.0.0.0:* LISTEN 3298/unbound
tcp 0 0 0.0.0.0:53 0.0.0.0:* LISTEN 3298/unbound
tcp6 0 0 ::1:8953 :::* LISTEN 3298/unbound
udp 0 0 0.0.0.0:53 0.0.0.0:* 3298/unbound

你可能感兴趣的:(linux dns服务)