Sample Header Ad - 728x90

systemd DNS resolver broken by USB-connected iPhone - how to prevent?

0 votes
1 answer
69 views
Today, on my Ubuntu 22.04.5 computer, I discovered two unknown nameservers in /etc/resolv.conf (symlink to /run/systemd/resolve/resolv.conf):
nameserver fe80::e0eb:40ff:fe79:e364%36     # Does not belong
nameserver 172.20.10.1                      # Does not belong
nameserver 192.168.1.1                      # Correct nameserver
search .
As a result, all local hostnames on my intranet (e.g., *myhost*) were failing to resolve. Rerunning sudo systemd restart systemd-resolved.service did not change anything. I finally tracked down the problem to my iPhone 8 which was connected by a USB cable to the computer. The iPhone was running a Personal Hotspot, and **systemd** was treating it as my primary nameserver, overriding 192.168.1.1. How can I prevent this problem from happening in the future when my iPhone is connected to the computer? Is there some way to tell **systemd** to ignore the iPhone's hotspot? Thank you very much.
Asked by DanB (488 rep)
Oct 28, 2024, 01:34 PM
Last activity: Oct 28, 2024, 03:35 PM