首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >DHCP:为DNS服务器做端口广告(而不是53)

DHCP:为DNS服务器做端口广告(而不是53)
EN

Server Fault用户
提问于 2018-10-30 20:45:52
回答 1查看 1.4K关注 0票数 -1

在我的网络中,我有一个小的码头群运行几个应用程序。最近,我尝试设置两个新的服务,提供带有ispcpd的DHCP和不绑定到网络的DNS。

群的主人是一个新的QNAP控制几个Pi3 (为了可用性,SDCards有时在24/7的使用中崩溃)。DHCP已启动并正在运行,但不能在端口53上启动DNS,因为该端口被QNAP上的dnsmasq阻塞。QNAP容器站中的docker/lxc实现用于集装箱网络中dhcp/dns服务的dnsmasq。所以这个端口被封锁了。我可以在另一个港口运行,比如说54号。但是在DHCP选项中,据我从文档中可以看到,我只能列出dns服务器,但没有端口规范。

是否有一种方式来为DNS服务器以及端口信息做广告?

EN

回答 1

Server Fault用户

回答已采纳

发布于 2018-11-02 16:43:11

正如Michael所提到的,I不能为DNS发布特定端口的广告。

因为我不想更改QNAP dnsmasq-config (在每个包更新中都会丢失),所以我在我的码头群中的其他节点(而不是QNAP本身)上安装了一个systemd服务,将dns启动为本地容器。

这样,qnap就不会试图绑定主机端口53,因为容器不会在群集范围内运行。

有点主题,但这是我用于服务的脚本:

代码语言:javascript
复制
#
# Docker + unbound DNS systemd service
#
# This service aims to make the update and invocation of the docker-dns
# container seemless.  It automatically downloads the latest docker-dns
# image and instantiates a Docker container with that image.  At shutdown it
# cleans-up the old container.
#
# In the event the service dies (crashes, or is killed) systemd will attempt
# to restart the service every 10 seconds until the service is stopped with
# `systemctl stop docker-dns@NAME`.
#
# To use:
# 1. Create a Docker volume source folder named `NAME` in DATA_SRC path where NAME is the
#    user's choice to describe the use of the container.
# 2. Download this service file to /etc/systemd/system/docker-dns@.service
# 3. Enable and start the service template with:
#    `systemctl enable --now docker-dns@NAME.service`
# 4. Verify service start-up with:
#    `systemctl status docker-dns@NAME.service`
#    `journalctl --unit docker-dns@NAME.service`
#
# For more information, see the systemd manual pages.
#
[Unit]
Description=unbound DNS Docker Container
Documentation=
After=network.target docker.socket
Requires=docker.socket

[Service]
RestartSec=10
Restart=always

Environment="NAME=dns-%i"
Environment="DATA_VOL=/mnt/nas/dns/%i"
Environment="IMG=192.168.0.65:6088/unbound:latest"

# To override environment variables, use local configuration directory:
# /etc/systemd/system/docker-openvpn@foo.d/local.conf
# http://www.freedesktop.org/software/systemd/man/systemd.unit.html

# Clean-up bad state if still hanging around
ExecStartPre=-/usr/bin/docker rm -f $NAME

# Attempt to pull new image for security updates
ExecStartPre=-/usr/bin/docker pull $IMG

# Main process
ExecStart=/usr/bin/docker run --rm -v ${DATA_VOL}:/usr/local/etc/unbound.zones.d.src --name ${NAME} -p 53 -p 53/udp --net=host ${IMG} $

[Install]
WantedBy=multi-user.target
票数 0
EN
页面原文内容由Server Fault提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://serverfault.com/questions/937944

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档