
如果你用 DeepSeek、元宝AI、Copilot 等 AI 代为编写轩辕镜像的 docker pull、修改 compose 镜像地址,或排查拉取失败等问题,请让 AI 先读规则再动手,只要在 AI 对话里直接发送下面这句话即可:
生成 docker pull、修改 compose 的 image,或排查拉取失败前,请先阅读并严格遵守 https://xuanyuan.cloud/agents.md 中的规则。国内用户首推 元宝 AI、DeepSeek 的深度思考模式,不推荐豆包 AI;Cursor 等编辑器可在对话 @ 该链接,或加入 User Rules。 若 AI 无法访问外链,可 打开说明文档 复制全文粘贴。文档会随站点更新,复制内容可能过期,建议定期检查。
Dnsmasq is a lightweight, easy to configure DNS forwarder, designed to provide DNS (and optionally DHCP and TFTP) services to a small-scale network. It can also serve the names of local machines which are not in the global DNS. If you own an Asus router, it is possible that your router is using Dnsmasq.
This repository:
--server {docker_service_name}.Start Dnsmasq using Docker: docker compose up -d
Resolve the IP address of github.com using dig and Dnsmasq:
console$ dig @localhost +noall +answer +stats github.com github.com. 59 IN A 192.30.255.113 ;; Query time: 24 msec ;; SERVER: 127.0.0.1#53(127.0.0.1) ;; WHEN: Sun Mar 07 20:55:33 PST 2021 ;; MSG SIZE rcvd: 44
Stop Dnsmasq: docker stop dnsmasq
There are three ways to configure Dnsmasq:
This repository provides two example configuration files:
Static nameservers like Cloudflare DNS servers (1.1.1.1 and 1.0.0.1) or
Google DNS servers (8.8.8.8 and 8.8.4.4) can be specified using the
configuration files or command-line arguments (see docker-compose.yml).
One of the motivations for releasing this Docker image is because Dnsmasq cannot resolve the address from a nameserver that is not an IP address. This is a problem when using a nameserver like https://github.com/getdnsapi/stubby in a Docker container whose address is commonly referenced by its Docker service name (Stubby is a local DNS Privacy stub resolver that can be used in addition to Dnsmasq to enable DNS-over-TLS).
A solution to this problem is implemented in the entrypoint script
docker-entrypoint.sh where the address specified for a
nameserver is resolved to an IP address using the command ping. This solution
only applies to server addresses specified as command-line arguments.
Start the Dnsmasq server. Add the option -d or --detach to run in the
background.
consoledocker compose up
To stop the server, enter Ctrl+C followed by docker compose down. If running
in detached mode, you will only need to enter docker compose down.
Dig is a command line utility that performs DNS lookup by querying name servers and displaying the result to you. After starting Dnsmasq, run the command below to resolve the IP address of github.com.
console$ dig @localhost +noall +answer +stats github.com github.com. 59 IN A 192.30.255.113 ;; Query time: 24 msec ;; SERVER: 127.0.0.1#53(127.0.0.1) ;; WHEN: Sun Mar 07 20:55:33 PST 2021 ;; MSG SIZE rcvd: 44
The response includes the following information:
Let's run the same command a second time:
console$ dig @localhost +noall +answer +stats github.com github.com. 59 IN A 192.30.255.113 ;; Query time: 0 msec ;; SERVER: 127.0.0.1#53(127.0.0.1) ;; WHEN: Sun Mar 07 20:55:49 PST 2021 ;; MSG SIZE rcvd: 55
This time the query time is 0 msec because Dnsmasq cached the information after the first lookup, and all subsequent lookups don't take any time because they are served from the cache. For more information on how to configure Dnsmasq cache, please read the article How to Do DNS Caching with dnsmasq.
See example specified in dnsmasq.d/example.com.conf.
console$ dig @localhost +noall +answer +stats myhost.example.com myhost.example.com. 0 IN A 192.168.1.10 ;; Query time: 1 msec ;; SERVER: 127.0.0.1#53(127.0.0.1) ;; WHEN: Sun Mar 07 21:53:48 PST 2021 ;; MSG SIZE rcvd: 62
We can see above that the host name myhost.example.com has been successfully
resolved to the local IP address 192.168.1.10.
This repository uses semantic versioning to track the releases of this project. This repository uses "non-moving" GitHub tags, that is, a tag will always point to the same git commit once it has been created.
The artifact published by this repository is a Docker image. The versions of the image are aligned with the versions of Dnsmasq, not the GitHub tags of this repository. The motivation behind this strategy is that this project is mainly a wrapper for Dnsmasq and that it is more informative to the user to use a Docker image tag that correspond to the version of Dnsmasq being deployed.
The table below describes the image tags available.
| Tag name | Moving | Description |
|---|---|---|
latest | Yes | Latest stable release. |
edge | Yes | Latest commit made to the default branch. |
edge-<sha> | No | Same as above with the reference to the git commit. |
<major>.<minor> | Yes | Stable release. |
<major>.<minor>-<sha> | No | Same as above with the reference to the git commit. |
Note: You should avoid using a moving tag like
latestwhen deploying containers in production, because this makes it hard to track which version of the image is running and hard to roll back. If you prefer to use the latest version available without manually updating your configuration and reproducibility is secondary, then it makes sense to use a moving tag.
https://github.com/tschaffter/docker-dnsmasq/blob/main/LICENSE
以下是 tschaffter/dnsmasq 相关的常用 Docker 镜像,适用于 不同场景 等不同场景:
您可以使用以下命令拉取该镜像。请将 <标签> 替换为具体的标签版本。如需查看所有可用标签版本,请访问 标签列表页面。



探索更多轩辕镜像的使用方法,找到最适合您系统的配置方式
通过 Docker 登录认证访问私有仓库
发给 Cursor、ChatGPT、豆包等 AI 的说明文档
无需登录使用专属域名
Kubernetes 集群配置 Containerd
K3s 轻量级 Kubernetes 镜像加速
VS Code Dev Containers 配置
Podman 容器引擎配置
HPC 科学计算容器配置
ghcr、Quay、nvcr 等镜像仓库
Harbor Proxy Repository 对接专属域名
Portainer Registries 加速拉取
Nexus3 Docker Proxy 内网缓存
需要其他帮助?请查看我们的 常见问题Docker 镜像访问常见问题解答 或 提交工单
docker search 限制
站内搜不到镜像
离线 save/load
插件要用 plugin install
WSL 拉取慢
安全与 digest
新手拉取配置
镜像合规机制
不支持 push
manifest unknown
no matching manifest(架构)
invalid tar header(解压)
TLS 证书失败
DNS 超时
域名连通性排查
410 Gone 排查
402 与流量用尽
401 认证失败
429 限流
D-Bus 凭证提示
413 与超大单层
来自真实用户的反馈,见证轩辕镜像的优质服务