What is working:
- Internet access
- The configured Static IP
- Pinging other machines in Lan (IP and hostname)
What I'm trying to solve:
I can't ping/ssh etc. the Ubuntu server from other clients using the hostname. IP works fine.
I have an AVM Fritz Box router acting as the DHCP/DNS server. It took a few days for my Windows 10 machine to be available via hostname, I thought it would be the same with the server, but it's been a week and still nothing.
The router displays the hostname in the gui.
Upon installation I chose DHCP, I could reach the server using the hostname, it stopped working when I switched to static IP.
/etc/netplan/00-installer-config.yaml:
# This is the network config written by 'subiquity'
network:
renderer: networkd
ethernets:
enp2s0:
dhcp4: false
dhcp6: false
version: 2
bridges:
br0:
interfaces: [enp2s0]
addresses:
- 192.168.1.4/24
gateway4: 192.168.1.1
nameservers:
addresses:
- 192.168.1.1
search:
- fritz.box
dhcp4: no
dhcp6: no
I am using LXD containers, that's why I need the bridge. But it wasn't working even before I added br0.
What I tried:
- Messing around with systemd-resolved
I disabled it, as suggested somewhere, didn't work. Tried to force 192.168.1.1 into /etc/resolv.conf, also didn't work. - I recently installed PiHole in a container, configured the router to redirect all DNS requests to it and it's working well, from what I can tell. I tried adding a manual DNS record via the PiHole gui, still nothing. Tried adding the server IP manually to /etc/hosts in the PiHole container... nothing.
- I installed another Ubuntu Server instance in a VM, configuring static IP within the installer and comparing the config files (at least the ones I know about). That's where I got the
search:
line in the netplan yaml file from, unfortunately not much else.
Pinging my Windows 10 PC, which is also configured with a static IP (ping pc-hostname
) comes back as 192.168.1.2 pc-hostname.fritz.box.
It's really hard to get info on this. Methods of configuring static IP differ a lot between releases, even between server and desktop of the same release. From the few articles and blog posts I've found with the 20.04 netplan method, none of them appear to do things differently.
Edit:
IPs:
fritz.box 192.168.1.1
ubuntuserver 192.168.1.4
Win10 192.168.1.2
PiHole 192.168.1.5