troubleshooting Question

resolv.conf is was deleted, and now things are not correct:  I am trying to install dnsmaq, and I issued the following commands

Avatar of Johnny
JohnnyFlag for United States of America asked on
DNSUbuntuLinuxLinux OS DevLinux Distributions
9 Comments1 Solution195 ViewsLast Modified:
The issue is strait forward.  On Ubuntu 18.04 I have deleted reolve.conf from the /ETC dir.  Resolv.conf appears to get recreated on reboot but it does not contain any DNS server entries save 127.0.0.53.  This will not work, you cannot edit the file as it is symbolically linked.  How do I correct, and provide it with the correct entries.  I was trying to install Dnsmasq.  The following commands were issue

john@VBserver1:~$ sudo systemctl stop systemd-resolved
john@VBserver1:~$ sudo ls -lh /etc/resolv.conf
lrwxrwxrwx 1 root root 37 Feb 17 21:35 /etc/resolv.conf -> /run/systemd/resolve/stub-resolv.conf
john@VBserver1:~$ sudo rm /etc/resolv.conf
john@VBserver1:~$ echo "nameserver 8.8.8.8" > /etc/resolv.conf
-bash: /etc/resolv.conf: Permission denied
john@VBserver1:~$ sudo echo "nameserver 8.8.8.8" > /etc/resolv.conf   This one is where the failure results.
-bash: /etc/resolv.conf: Permission denied
john@VBserver1:~$
ASKER CERTIFIED SOLUTION
David Favor
Fractional CTO
Join our community to see this answer!
Unlock 1 Answer and 9 Comments.
Start Free Trial
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 1 Answer and 9 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros