As I'm far from an advanced network manager, please help me if you can.
Some weeks ago I 'reconfigured' my home network with a manageable DNS/DNS relay service to allow us to use home only domains instead of IP addresses (as the number of networked devices at home started to increase too much). The chosen solution was the usual 'dnsmasq' setup on my RPi (latest Ubuntu based for Home Assistant), and as a possibility I set it up also as our DHCP server instead of the previously configured router, to manage all relevant things at one place. This is my first 'dnsmasq' usage, but at the end it seemed that everything works fine... except for one thing:
When I restart the RPi, or the corresponding network services on it, all its DHCP connected clients somehow lose the DNS until their re-connection to the network again. For example, after an RPi reboot, my computer still has the previously leased IP address (and seems all the corresponding network settings), but the name resolution doesn't work further until I disconnect and reconnect my NIC to the network. Addressing with IP addresses is working further but the name resolution not. This result is also true all of my other devices (mobiles, notebooks, etc.).
After 'reconnect' everything works fine, but without it I simply cannot resolve the domain names.
Could anybody point me to the right direction what could be the reason of the problem if it is familiar?
Currently I use only the WiFi connection of the RPi...
Router/gateway IP: 192.168.1.1
'netplan' config in
/etc/netplan/50-cloud-init.yaml
:# This file is generated from information provided by the datasource. Changes # to it will not persist across an instance reboot. To disable cloud-init's # network configuration capabilities, write a file # /etc/cloud/cloud.cfg.d/99-disable-network-config.cfg with the following: # network: {config: disabled} network: version: 2 ethernets: eth0: dhcp4: true optional: true wifis: wlan0: optional: true access-points: "***": password: "***" hidden: true "***": password: "***" hidden: true dhcp4: false dhcp6: false addresses: [192.168.1.2/24] routes: - to: default via: 192.168.1.1 nameservers: addresses: [192.168.1.2,8.8.8.8]
All custom 'dnsmasq' settings in
/etc/dnsmasq.d/ebola.conf
:domain-needed bogus-priv no-resolv server=8.8.8.8 server=4.4.4.4 local=/home/ebola/ dhcp-range=192.168.1.201,192.168.1.255,255.255.255.0,168h dhcp-option=option:router,192.168.1.1 dhcp-lease-max=50 dhcp-authoritative cache-size=5000 #------------------------------ dhcp-host=...(mac,hostname,ip,infinite) dhcp-host=...(mac,hostname,ip,infinite) dhcp-host=...(mac,hostname,ip,infinite)
/etc/hosts
The devices and their IP addresses which I want to reach by their local domain names.
(Which latest requirement for me is interesting as I thought the DHCP host config section in the 'dnsmasq' config will define them, in case I define the hostnames there.)
sudo systemctl restart dnsmasq.service
), there is no problem. All devices reach the net and name resolution works fine. - After restart just 'networkd' (sudo systemctl status systemd-networkd
), there is no problem. All devices reach the net and name resolution works fine. - After restart the whole machine, previous clients loose name resolution until their network reconnect. In some minutes I will expand my original post with the corresponding config entries.