docker-compose搭建dns服务器

satuo20 1年前 ⋅ 301 阅读

https://www.cnblogs.com/jakaBlog/p/11381595.html

docker-compose.yaml

# 
version: '3.7'
services:
    dns-server:
      container_name: dns-server
      image: 'jpillora/dnsmasq'
      restart: always
      environment:
            - TZ=Asia/Shanghai
            - HTTP_USER=kpuser
            - HTTP_PASS=QpV2OB6yYogpxSo0YIDBasmz
      ports:
            - "53:53/udp"
            - "5380:8080"
      volumes:
            - "./config/dnsmasq.conf:/etc/dnsmasq.conf"

dnsmasq.conf

cache-size=150000
#dnsmasq config, for a complete example, see:
#  http://oss.segetech.com/intra/srv/dnsmasq.conf
#log all dns queries
log-queries
#dont use hosts nameservers
no-resolv
#use cloudflare as default nameservers, prefer 1^4
#server=192.168.0.53
#server=192.168.0.1
server=223.5.5.5
strict-order
#serve all .company queries using a specific nameserver(指定域名和DNS)
#server=/dev.local.yjzhixue.com/192.168.0.53
#server=/test.local.yjzhixue.com/192.168.0.53
#explicitly define host-ip mappings
# 精确指定域名
address=/demo.local.yjzhixue.com/192.168.0.52
address=/testclickhouse.local.yjzhixue.com/192.168.0.94
address=/devclickhouse.local.yjzhixue.com/192.168.0.96
address=/testredis.local.yjzhixue.com/192.168.0.94
address=/testmysql.local.yjzhixue.com/192.168.0.94
address=/testmq.local.yjzhixue.com/192.168.0.94
address=/testmongo.local.yjzhixue.com/192.168.0.94

全部评论: 0

    我有话说: