局域网内部 dns
局域网内部 dns
安装dnsmasq
- 在服务里面安装
dnsmasq
- 修改配置文件
/etc/dnsmasq.conf
,增加一个域名,强制解析到指定的地址上,例如
address= /wanderer.cloud/10.0.0.1` - 启动
dnsmasq
,sudo systemctl start dnsmasq
- 查看
53
端口,debian系netstat -tunlp | grep 53
archlinux系ss -a | grep 53
- 其他电脑使用这个
dns
服务器,则需要设置/etc/resolv.conf
文件nameserver 10.0.0.1
解析局域网的ip地址为二级域名
- 需要安装
caddy
- 修改配置文件,将本地的
nextcloud
gitea
服务的ip地址解析成二级域名1 2 3 4 5 6 7 8
http://wanderer.cloud{ gzip proxy / http://127.0.0.1:9000 } http://git.wanderer.cloud{ gzip proxy / http://127.0.0.1:3000 }
This post is licensed under CC BY 4.0 by the author.