docker-dnsmasq使用

docker-dnsmasq支持通过web页面配置域名映射,镜像地址:https://hub.docker.com/r/jpillora/dnsmasq

使用步骤如下:

1、在Docker宿主上创建 /opt/dnsmasq.conf 配置文件

touch /opt/dnsmasq.conf

2、docker run启动容器

docker run 
    --name dnsmasq 
    -d 
    -p 53:53/udp 
    -p 5380:8080 
    -v /opt/dnsmasq.conf:/etc/dnsmasq.conf 
    --log-opt "max-size=100m" 
    -e "HTTP_USER=admin" 
    -e "HTTP_PASS=123456" 
    --restart always 
    jpillora/dnsmasq

HTTP_USER:web页面登录的管理员帐号

HTTP_PASS:web页面登录的管理员密码

3、通过 ip:5380 地址访问web页面,使用帐户密码登录后在线编辑 dnsmasq.conf 文件

我的dnsmasq.conf配置文件内容如下:

server=172.16.20.150
address=/test.gfstack.geo/192.168.36.158

 
项目地址:https://github.com/jpillora/docker-dnsmasq

原文地址:https://www.cnblogs.com/nihaorz/p/10824673.html