Trata-se de fornecer uma solução total para uma rede doméstica local -
dnsmasq
server configurado para rede doméstica local e eu uso o mesmo servidor para atuar como servidor DHCP também. Ele funciona bem dentro do próprio servidor. Ou seja, de alguma forma, o dnsmasq
instalado nesses laptops do Ubuntu não pode fazer a consulta DNS da LAN do meu servidor DNS, mesmo que eu tenha desabilitado o serviço DNS no meu roteador. Ou seja, todos os serviços DNS devem ter sido fornecidos pelo meu servidor DNS. Todos esses laptops do Ubuntu têm dnsmasq
no arquivo nameserver 127.0.1.1
, que por sua vez deve armazenar em cache a resolução do DNS do meu servidor DNS, certo?
UPDATE2:
Acontece que é o NetworkManager (dos laptops do Ubuntu) que está fazendo com que eles tenham uma configuração de servidor de nomes /etc/resolv.conf
estranha. Aqui está o log do dhclient para renovação do DHCP:
Oct 5 21:07:27 mylptp NetworkManager[854]: <info> [1507252047.0729] manager: NetworkManager state is now DISCONNECTED
Oct 5 21:07:42 mylptp NetworkManager[854]: <info> [1507252062.9239] device (eth0): Activation: starting connection 'Wired connection 1' (daa2...b460)
Oct 5 21:07:42 mylptp NetworkManager[854]: <info> [1507252062.9241] audit: op="connection-activate" uuid="daa2...b460" name="Wired connection 1" pid=4822 uid=0 result="success"
Oct 5 21:07:42 mylptp NetworkManager[854]: <info> [1507252062.9243] device (eth0): state change: disconnected -> prepare (reason 'none') [30 40 0]
Oct 5 21:07:42 mylptp NetworkManager[854]: <info> [1507252062.9245] manager: NetworkManager state is now CONNECTING
Oct 5 21:07:42 mylptp NetworkManager[854]: <info> [1507252062.9253] device (eth0): state change: prepare -> config (reason 'none') [40 50 0]
Oct 5 21:07:42 mylptp NetworkManager[854]: <info> [1507252062.9266] device (eth0): state change: config -> ip-config (reason 'none') [50 70 0]
Oct 5 21:07:42 mylptp NetworkManager[854]: <info> [1507252062.9270] dhcp4 (eth0): activation: beginning transaction (timeout in 45 seconds)
Oct 5 21:07:42 mylptp NetworkManager[854]: <info> [1507252062.9299] dhcp4 (eth0): dhclient started with pid 4826
Oct 5 21:07:42 mylptp dhclient[4826]: DHCPREQUEST of 192.168.2.126 on eth0 to 255.255.255.255 port 67 (xid=0x71e88c46)
Oct 5 21:07:42 mylptp dhclient[4826]: DHCPACK of 192.168.2.126 from 192.168.2.102
Oct 5 21:07:42 mylptp NetworkManager[854]: <info> [1507252062.9619] dhcp4 (eth0): address 192.168.2.126
Oct 5 21:07:42 mylptp NetworkManager[854]: <info> [1507252062.9620] dhcp4 (eth0): plen 24 (255.255.255.0)
Oct 5 21:07:42 mylptp NetworkManager[854]: <info> [1507252062.9620] dhcp4 (eth0): gateway 192.168.2.1
Oct 5 21:07:42 mylptp NetworkManager[854]: <info> [1507252062.9620] dhcp4 (eth0): server identifier 192.168.2.102
Oct 5 21:07:42 mylptp NetworkManager[854]: <info> [1507252062.9620] dhcp4 (eth0): lease time 4294967295
Oct 5 21:07:42 mylptp avahi-daemon[799]: Joining mDNS multicast group on interface eth0.IPv4 with address 192.168.2.126.
Oct 5 21:07:42 mylptp NetworkManager[854]: <info> [1507252062.9620] dhcp4 (eth0): hostname 'mylptp'
Oct 5 21:07:42 mylptp avahi-daemon[799]: New relevant interface eth0.IPv4 for mDNS.
Oct 5 21:07:42 mylptp NetworkManager[854]: <info> [1507252062.9620] dhcp4 (eth0): nameserver '192.168.2.102'
Oct 5 21:07:42 mylptp avahi-daemon[799]: Registering new address record for 192.168.2.126 on eth0.IPv4.
Oct 5 21:07:42 mylptp NetworkManager[854]: <info> [1507252062.9620] dhcp4 (eth0): domain name 'my.domain.name'
Oct 5 21:07:42 mylptp NetworkManager[854]: <info> [1507252062.9621] dhcp4 (eth0): state changed unknown -> bound
Oct 5 21:07:42 mylptp NetworkManager[854]: <info> [1507252062.9630] device (eth0): state change: ip-config -> ip-check (reason 'none') [70 80 0]
Oct 5 21:07:42 mylptp NetworkManager[854]: <info> [1507252062.9635] device (eth0): state change: ip-check -> secondaries (reason 'none') [80 90 0]
Oct 5 21:07:42 mylptp NetworkManager[854]: <info> [1507252062.9637] device (eth0): state change: secondaries -> activated (reason 'none') [90 100 0]
Oct 5 21:07:42 mylptp NetworkManager[854]: <info> [1507252062.9638] manager: NetworkManager state is now CONNECTED_LOCAL
Oct 5 21:07:43 mylptp NetworkManager[854]: <info> [1507252063.0394] manager: NetworkManager state is now CONNECTED_GLOBAL
Oct 5 21:07:43 mylptp NetworkManager[854]: <info> [1507252063.0395] policy: set 'Wired connection 1' (eth0) as default for IPv4 routing and DNS
Oct 5 21:07:43 mylptp NetworkManager[854]: <info> [1507252063.0403] device (eth0): Activation: successful, device activated.
Oct 5 21:10:43 mylptp systemd-resolved[1009]: Switching to DNS server 192.168.2.102 for interface eth0.
Oct 5 21:10:43 mylptp systemd-resolved[1009]: Using degraded feature set (TCP) for DNS server 127.0.1.1.
Oct 5 21:10:43 mylptp systemd-resolved[1009]: Using degraded feature set (UDP) for DNS server 127.0.1.1.
Oct 5 21:10:43 mylptp systemd-resolved[1009]: Using degraded feature set (TCP) for DNS server 127.0.1.1.
Oct 5 21:10:43 mylptp systemd-resolved[1009]: Using degraded feature set (UDP) for DNS server 127.0.1.1.
Oct 5 21:10:43 mylptp systemd-resolved[1009]: Using degraded feature set (TCP) for DNS server 127.0.1.1.
Oct 5 21:10:43 mylptp systemd-resolved[1009]: Using degraded feature set (UDP) for DNS server 127.0.1.1.
Eu cortei o log longo em grupos para maior clareza. A partir do log, podemos ver claramente que o 127.0.1.1
foi empurrando o endereço IP correto do servidor DNS na resposta DHCP (grupo 3, última linha). No entanto, é o
NetworkManager (ou dnsmasq
) que está agindo (grupo 6, primeira linha).
Por que o NetworkManager / systemd-resolved não está usando o servidor DNS correto que é instruído a usar? Meu laptop não tem problema em usar / consultar meu servidor DNS local:
me@mylptp$ dig @192.168.2.102 coral
...
;; ANSWER SECTION:
coral. 0 IN A 192.168.2.102
;; Query time: 0 msec
;; SERVER: 192.168.2.102#53(192.168.2.102)
;; WHEN: Thu Oct 05 21:16:22 EDT 2017
;; MSG SIZE rcvd: 50
Todas as minhas máquinas são de:
$ lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description: Ubuntu 17.04
Release: 17.04
Codename: zesty
$ ls -l /etc/resolv.conf
lrwxrwxrwx 1 root root 35 2017-10-05 21:07 /etc/resolv.conf -> /var/run/NetworkManager/resolv.conf
Por favor ajude.
UPDATE1:
O que eu estou perdendo é que eu " deveria estar empurrando o endereço IP correto do servidor DNS / DHCP na resposta DHCP ", graças ao dirkt para a direção. No entanto, como posso fazer isso com systemd-resolved
? Já estive nos seguintes URLs, mas nenhum me deu a resposta:
Thx.
Tags dns networking dnsmasq lan linux