The symbolic link /etc/resolv.conf points to the wrong file by default
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
systemd (Ubuntu) |
Invalid
|
Undecided
|
Unassigned |
Bug Description
When using nslookup for local machine names, the local DNS was being ignored (not queried) and none of the local machines could be found.
After much research and digging, it was discovered that the cause was the incorrect symbolic link /etc/resolv.conf file.
The default install caused systemd-resolve to configure the link to point to the stub file:
/etc/resolv.conf -> ../run/
Reomving that link and pointing it to the correct file solved the DNS lookup issue. The correct link looks like this:
/etc/resolv.conf -> /run/systemd/
Steps used to test the bug before fixing the link is to perform an nslookup on a local (non FQDN) machine that is in your local DNS (my router is my DNS server for this case) Here is an example of the incorrect output:
$ nslookup web1
Server: 127.0.0.53
Address: 127.0.0.53#53
** server can't find web1: SERVFAIL
Switching the symbolic link solves the problem. Here is my solution:
$ sudo rm -f /etc/resolv.conf
$ sudo ln -s /run/systemd/
After switching the symbolic link, the nslookup functions properly.
$ nslookup web1
Server: 192.168.1.1
Address: 192.168.1.1#53
Name: web1
Address: 192.168.1.107
ProblemType: Bug
DistroRelease: Ubuntu 18.04
Package: systemd 237-3ubuntu10
ProcVersionSign
Uname: Linux 4.15.0-22-generic x86_64
ApportVersion: 2.20.9-0ubuntu7
Architecture: amd64
CurrentDesktop: ubuntu:GNOME
Date: Fri Jun 1 05:28:41 2018
InstallationDate: Installed on 2018-01-20 (131 days ago)
InstallationMedia: Ubuntu 17.10 "Artful Aardvark" - Release amd64 (20180105.1)
MachineType: Dell Inc. Inspiron 5755
ProcEnviron:
TERM=xterm-
PATH=(custom, no user)
XDG_RUNTIME_
LANG=en_US.UTF-8
SHELL=/bin/bash
ProcKernelCmdLine: BOOT_IMAGE=
SourcePackage: systemd
UpgradeStatus: Upgraded to bionic on 2018-04-28 (33 days ago)
dmi.bios.date: 08/27/2015
dmi.bios.vendor: Dell Inc.
dmi.bios.version: A08
dmi.board.name: 0VY15F
dmi.board.vendor: Dell Inc.
dmi.board.version: A00
dmi.chassis.type: 8
dmi.chassis.vendor: Dell Inc.
dmi.chassis.
dmi.modalias: dmi:bvnDellInc.
dmi.product.name: Inspiron 5755
dmi.product.
dmi.sys.vendor: Dell Inc.
Status changed to 'Confirmed' because the bug affects multiple users.