CentOS 6 添加 dns 缓存

2021/09/13 centos dns cache 共 433 字,约 2 分钟

安装 dnsmasq

yum install dnsmasq -y

修改配置文件:

修改配置文件:/etc/dnsmasq.conf 添加以下内容:

resolv-file=/etc/resolv.dnsmasq.conf
listen-address=127.0.0.1
no-dhcp-interface=lo
bind-interfaces
no-negcache

修改配置文件: /etc/resolv.conf 添加以下内容:

nameserver 127.0.0.1
nameserver 119.28.28.28
nameserver 114.114.114.114

修改配置文件:/etc/resolv.dnsmasq.conf 添加以下内容:

nameserver 119.29.29.29
nameserver 119.28.28.28
nameserver 114.114.114.114
nameserver 114.114.115.115

重启 dnsmasq 服务:

service dnsmasq restart

文档信息

Search

    Table of Contents