Docker 部署 DNS 服务
配置 coredns
mkdir -p /data/coredns
vi /data/coredns/Corefile
.:53 {
hosts {
10.97.111.111 baidu.com
10.97.111.111 google.com
fallthrough
}
forward . 223.5.5.5 8.8.8.8
cache 30
log
}
启动 coredns
docker run -d \
--name coredns \
--restart=always \
--network host \
-v /data/coredns/Corefile:/Corefile \
coredns/coredns -conf /Corefile
测试解析
nslookup baidu.com 127.0.0.1
版权声明:
本站所有文章除特别声明外,均采用 CC BY-NC-SA 4.0 许可协议。转载请注明来自
One piece!
喜欢就支持一下吧