根据此页面,它似乎很简单。但是,/etc/bind
在 Ubuntu 12.04.3 LTS 服务器的默认安装中不存在。
那么,在不安装任何其他软件的情况下,如何在 ubuntu 服务器上配置 DNS 并删除 dnsmasq?我对sudo
&很熟悉nano
。
Ubuntu 16.10+systemd-resolved
用作 DNS 解析器。
我更喜欢将 setup 16.04dnsmasq
用作解析器。
我怎么能在 16.10+ 上做到这一点,尤其是在 17.04 上?
我不知道如何重新启动 dnsmasq。
service dnsmasq restart
dnsmasq: unrecognized service
Run Code Online (Sandbox Code Playgroud)
解决方案
重新启动网络管理器(他的父母)
sudo service network-manager restart
Run Code Online (Sandbox Code Playgroud) 如何知道 DNSMasq 使用哪些 DNS 服务器将名称解析为 IP 地址?我想不通。这里所有现有的问题似乎只是告诉用户他们正在使用 DNSMasq。
我正在按照以下链接设置服务器 https://help.ubuntu.com/community/Dnsmasq
root@user-desktop:/etc/init.d# sudo apt-get install dnsmasq
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following NEW packages will be installed:
dnsmasq
0 upgraded, 1 newly installed, 0 to remove and 0 not upgraded.
Need to get 0 B/15.4 kB of archives.
After this operation, 120 kB of additional disk space will be used.
Selecting previously unselected package dnsmasq.
(Reading database ... 146283 files and directories currently installed.)
Unpacking dnsmasq (from .../dnsmasq_2.59-4_all.deb) ...
Processing triggers for …
Run Code Online (Sandbox Code Playgroud) 出于开发目的,我希望对 .dev TLD 的所有 DNS 请求都转发到我自己的 PC。
主机文件是不够的。我使用多个域和多个子域。我必须为每个组合添加一行。
我读过像 DNSmasq 这样的 DNS 转发器可以用来完成这项工作(例如这里描述的)。此外,该软件已安装在 Ubuntu 12.10 上。
问题是我看不到我应该如何以及在哪里配置 DNSmasq,即我应该把这条线放在哪里:
address=/dev/127.0.0.1
Run Code Online (Sandbox Code Playgroud) 从 12.04 开始,Ubuntu 将 DNSMasq 实例用于网络管理器 - 如何禁用它?
我刚刚将我的笔记本电脑从 Xubuntu 17.04 升级到 17.10。最后一次重新启动后,DNS 已停止工作。这显然是个问题!我可以 ping 已知的 IP 地址;只是没有DNS解析。
我没有摆弄任何 DNS 设置;据我所知,我以前有标准的 DNS 配置。它只是一台笔记本电脑,它使用 DHCP 从我的家庭 WiFi 路由器获取详细信息。
显然,当系统本身无法解析任何网址时,诊断此问题的能力是有限的。我在手机上进行了一些谷歌搜索,我找到的大多数答案似乎都建议关闭 dnsmasq。但是,dnsmasq 已经关闭。但是/etc/resolv.conf
显示 127.0.1.1,这似乎暗示它期望 dnsmasq 正在运行。
我通过编辑/etc/NetworkManager/NetworkManager.conf
和添加打开了 dnsmasq
[main]
dns=dnsmasq
Run Code Online (Sandbox Code Playgroud)
然后我运行了这个命令
sudo systemctl restart NetworkManager
Run Code Online (Sandbox Code Playgroud)
我的 DNS 解析现在正在工作。
但是,鉴于默认的 Ubuntu 配置不使用 dnsmasq,我实际上应该做些什么来诊断和解决这个问题?
在 Ubuntu 14.04 上,我使用 dnsmasq 将通配符 example.com 域解析到本地计算机(家里的台式计算机)。
经过大量阅读后,我终生无法在 18.04 的全新安装中解决相同的问题。
我目前想要达到的目标是:
ping example.com
ping 127.0.0.1 而不是 93.184.216.34;ping anysubdomain.example.com
要同时ping 127.0.0.1;ping google.com
通过路由器/ IP DNS ping真正的google.com。这肯定很简单,甚至是微不足道的?
但我很难过。我可以得到 example.com 的解析,但前提是要破坏其他一切。
我怎样才能做到这一点?
我已经安装了 DNSMASQ,但它没有启动,因为 53 端口很忙。
我发现 ubuntu 已经有 dnsmasq 包并且它正在工作。
现在的问题是......我只是希望能够通过它解析我在 /etc/hosts 中的主机
即:nslookup somehostonlan localhost
要解析为从 /etc/hosts 文件中获取的某些 IP。
但这并没有发生。
为什么?顺便说一句,作为缓存 DNS 服务器,它工作正常。我只是想让它从 /etc/hosts 文件中解析主机