You need to enable JavaScript to run this app.
最新活动
大模型
产品
解决方案
定价
生态与合作
支持与服务
开发者
了解我们

Ubuntu 16.04添加DNS搜索域是否存在数量上限?

Hey there, I’ve dealt with this exact DNS search domain limit issue on Ubuntu 16.04 desktop before—let me break down how to get all your domains recognized properly.

Why This Happens

Ubuntu 16.04 uses dnsmasq (integrated with NetworkManager) for local DNS handling, and by default it caps the number of allowed search domains at 6. That’s why only 6 out of your 10 added domains are showing up in /etc/resolv.conf.

Step-by-Step Fix

1. Create a Custom dnsmasq Configuration File

First, we’ll add a config file to override the default limit. Open a terminal and run:

sudo mkdir -p /etc/NetworkManager/dnsmasq.d
sudo nano /etc/NetworkManager/dnsmasq.d/increase-search-limit.conf

In the nano editor, add this line (replace 10 with the exact number of domains you need):

domain-max=10

Save the file by pressing Ctrl+O, hit Enter, then exit with Ctrl+X.

2. Restart NetworkManager

To apply the new setting, restart NetworkManager (which manages dnsmasq on desktop editions):

sudo systemctl restart NetworkManager

3. Verify the Change

Check your /etc/resolv.conf again to confirm all domains are present:

cat /etc/resolv.conf

If they don’t appear right away, try disconnecting and reconnecting your wired network connection. A quick reboot will also work if you prefer.

Quick Troubleshooting

  • If the domains still don’t show up, double-check that you entered the correct number in domain-max and that your NetworkManager IPv4 settings still have all 10 domains listed.
  • Ensure there are no other dnsmasq config files in /etc/dnsmasq.d/ that might conflict with your new setting.

内容的提问来源于stack exchange,提问作者Guy Goodrick

火山引擎 最新活动