Sunday, April 28, 2024
 Popular · Latest · Hot · Upcoming
0
rated 0 times [  0] [ 0]  / answers: 1 / hits: 2807  / 3 Years ago, sat, november 6, 2021, 5:36:55

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

More From » networking

 Answers
3

Ok I finally figured it out, I had to enable MulticastDNS in /etc/systemd/resolved.conf:


[Resolve]
MulticastDNS=yes
LLMNR=no # You may need to set this as well, not sure

Honestly I'm not sure what combination specifically did it, I set up a Powershell script in the background, which would beep as soon as it could ping the hostname of the Ubuntu server. I was playing around with the config, with the resolvectl utility, changing essentially the same settings as are in this config, just per interface. After I set MulticastDNS the script beeped almost immediately. You will likely need to do a sudo systemctl restart systemd-resolved before it starts working.


[#750] Monday, November 8, 2021, 3 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
bleger

Total Points: 468
Total Questions: 108
Total Answers: 100

Location: Belarus
Member since Wed, Dec 7, 2022
1 Year ago
bleger questions
Wed, Mar 1, 23, 03:00, 1 Year ago
Mon, Feb 6, 23, 14:44, 1 Year ago
Wed, Dec 29, 21, 13:59, 2 Years ago
Fri, May 5, 23, 16:10, 1 Year ago
;