Каждый раз, когда я перезагружаю мой компьютер, NetworkManager устанавливает /etc/resolv.conf
на это, мой DNS перестает работать, и я получаю эту ошибку в Chrome.
/etc/resolv.conf
# Generated by NetworkManager
search tampabay.rr.com
nameserver 127.0.0.53
Ошибка Chrome:
DNS_PROBE_FINISHED_NO_INTERNET
Я временно разрешаю проблему, задав для этого /etc/resolv.conf
.
/etc/resolv.conf
nameserver 8.8.8.8
Я догадываюсь NetworkManager ожидает DNS-сервер на моем локальном компьютере 127.0.0.53, и у меня там не работает DNS. Как я могу постоянно установить 8.8.8.8
в качестве моего сервера имен? Если это действительно необходимо, как мне настроить DNS на 127.0.0.53
?
Я прочитал man resolv.conf
, но это мне не сильно помогло.
Я прочитал это ответьте и создайте файл /etc/resolvconf/resolv.conf.d/tail
с сервером имен 8.8.8.
Ubuntu 20.04 LTS
Программа DNS-кеша unbound
работала на порту 53 и не позволяла запустить dnsmasq
. Я удалил unbound
и dnsmasq
начинается сейчас. Однако он говорит, что по какой-то причине работает только на 0.0.0.0. Я полагаю, что он должен быть запущен на 127.0.0.1:53. Я переустановил dnsmasq, но он действует так же. /etc/dnsmasq.conf
полностью закомментирован.
При перезапуске /etc/resolv.conf
теперь установлен на
# Generated by resolvconf
nameserver 127.0.0.1
. Не уверен, как правильно запустить dnsmasq
.
/lib/systemd/system/dnsmasq.service
[Unit]
Description=dnsmasq - A lightweight DHCP and caching DNS server
Requires=network.target
Wants=nss-lookup.target
Before=nss-lookup.target
After=network.target
[Service]
Type=forking
PIDFile=/run/dnsmasq/dnsmasq.pid
# Test the config file and refuse starting if it is not valid.
ExecStartPre=/usr/sbin/dnsmasq --test
# We run dnsmasq via the /etc/init.d/dnsmasq script which acts as a
# wrapper picking up extra configuration files and then execs dnsmasq
# itself, when called with the "systemd-exec" function.
ExecStart=/etc/init.d/dnsmasq systemd-exec
# The systemd-*-resolvconf functions configure (and deconfigure)
# resolvconf to work with the dnsmasq DNS server. They're called like
# this to get correct error handling (ie don't start-resolvconf if the
# dnsmasq daemon fails to start.
ExecStartPost=/etc/init.d/dnsmasq systemd-start-resolvconf
ExecStop=/etc/init.d/dnsmasq systemd-stop-resolvconf
ExecReload=/bin/kill -HUP $MAINPID
[Install]
WantedBy=multi-user.target
journalctl -e --unit dnsmasq.service
-- Reboot --
Jul 08 23:41:54 phil-desktopubuntu-18-04-1-lts systemd[1]: Starting dnsmasq - A lightweight DHCP and caching DNS server...
Jul 08 23:41:54 phil-desktopubuntu-18-04-1-lts dnsmasq[7349]: dnsmasq: syntax check OK.
Jul 08 23:41:54 phil-desktopubuntu-18-04-1-lts dnsmasq[7369]: started, version 2.80 cachesize 150
Jul 08 23:41:54 phil-desktopubuntu-18-04-1-lts dnsmasq[7369]: DNS service limited to local subnets
Jul 08 23:41:54 phil-desktopubuntu-18-04-1-lts dnsmasq[7369]: compile time options: IPv6 GNU-getopt DBus i18n IDN DHCP DHCPv6 no-Lua TFTP conntrack ipset auth DNSSEC loop-detect inotify dumpfile
Jul 08 23:41:54 phil-desktopubuntu-18-04-1-lts dnsmasq[7369]: read /etc/hosts - 7 addresses
Jul 08 23:41:54 phil-desktopubuntu-18-04-1-lts dnsmasq[7369]: no servers found in /run/dnsmasq/resolv.conf, will retry
Jul 08 23:41:54 phil-desktopubuntu-18-04-1-lts systemd[1]: Started dnsmasq - A lightweight DHCP and caching DNS server.
Я понял это. Все было отмечено в моем /etc/dnsmasq.conf
. Мне пришлось установить сервер DNS.
/etc/dnsmasq.conf
server=8.8.8.8
/etc/resolv.conf
# Generated by resolvconf
nameserver 127.0.0.1
Эти команды были полезны при отладке
sudo systemctl status dnsmasq #dnsmasq should be running
sudo netstat -tulpn #dnsmasq should be listening on 0.0.0.0:53
nslookup debian.org localhost #should return IP address of debian.org