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