2

I have a new Ubuntu 18.04 VM running in VirtualBox on Windows 10. I'm connected to a local network and able to resolve local addresses from Windows. However, my Ubuntu VM can only reach internet addresses.

From the command line, I see my DNS server listed as 127.0.0.53 yet NetworkManager correctly displays the 10.x.x.x address of the DNS server on my local network.

I've fiddled around a bit with various network settings but I'm not sure how to resolve this. Any help is appreciated, thanks!

EDIT1: Interestingly, my DNS servers appear to be correct but my browser and shell commands like nslookup aren't using it by default. When I run nslookup , it works perfectly fine.

EDIT2: I tried the --natdnshostresolver1 command which @Fabby recommended, no luck there.

EDIT3: this is what my resolv.conf file looks like:

# Dynamic resolv.conf(5) file for glibc resolver(3) generated by 
resolvconf(8)
#     DO NOT EDIT THIS FILE BY HAND -- YOUR CHANGES WILL BE OVERWRITTEN
# 127.0.0.53 is the systemd-resolved stub resolver.
# run "systemd-resolve --status" to see details about the actual nameservers.

nameserver 127.0.0.53
7
  • What does VBoxManage modifyvm szVMName --natdnshostresolver1 on do where szVMName is tour Virtual Machine name?
    – Fabby
    May 25 '18 at 20:28
  • No difference, I've tried that too. May 25 '18 at 20:35
  • How about $ systemctl status systemd-resolved. resolved is the 18.04 name resolver May 26 '18 at 0:53
  • @StephenBoston that command show this: Using degraded feature set (UDP) for DNS server 10.0.2.3 May 26 '18 at 1:20
  • Which isn't the correct DNS server. May 26 '18 at 1:22
2

You can resolve this by installing the resolvconf app from the repository. Up until Ubuntu 18.04 LTS the app was installed by default.

$ sudo install resolvconf

After installing resolvconf on your VM client, add your desired DNS server to the /etc/resolvconf/resolv.conf.d/head file.

Place nameserver [your preferred dns server] at the bottom of the file. After rebooting your VM client, you will see the content of the /etc/resolvconf/resolv.conf.d/head file in your /etc/resolv.conf file, which will take precedence of other settings.

4
  • 1
    L.D James, that worked. . . I'd love to know what was wrong but either way, it's working now. Thanks! May 26 '18 at 2:02
  • @L. D. James That solved the issue I was having. Do you know why some things were seeing the correct nameserver and some things weren't? What exactly is this solution doing? Mar 15 '19 at 17:28
  • 1
    Hmm, right at the top of head it says DO NOT EDIT THIS FILE BY HAND... So is there a more proper way to configure dns?
    – Jack
    Apr 5 '20 at 22:17
  • Did you mean sudo apt-get install resolvconf ? 2 days ago

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.