Score:0

Restore Default Ubuntu 22.04 DNS Settings

tr flag

Situation
Prior, to properly backing up my freshly installed Ubuntu 22.04 with Timeshift... I attempted to instead install dsnmasq for local web development. Of course, I broke my DNS and now my fresh install has no internet access :-(

Error
These are the exact step from my personal notes that caused the error:

1. Disable & stop systemd resolved  

    $ sudo systemctl disable systemd-resolved  
    $ sudo systemctl stop systemd-resolved

2. Remove symlink on `/etc/resolv.conf` & remove the file

    $ ls -lh /etc/resolv.conf  
    $ sudo rm /etc/resolv.conf

3. create new /etc/resolv.conf
   
   sudo bash -c 'echo "nameserver 127.0.0.1" > /etc/resolv.conf' 


After item 3.) above, I completely lost internet access.

Troubleshooting

1.) I easily re-enabled systemd-resolved

Update: @keff suggested solution below, seems to be correct, but it does not work.

1.) I created a virtualbox installation of ubuntu 22.04 and made a copy of /etc/resolv.conf that I put in my shared folder and took a screenshot of the ls -l /etc/resolv.conf output.

2.) I followed @keff's instructions and compared the results to my virtualbox output... they match. I rebooted the machine to ensure all possible services get a restart.

DNS just isn't working, although it is correctly configured. I have two laptops connected to the same wifi connection, so I know the wifi is working correctly.

I am stumped.

(yes, port 53 is open in ufw)

Question The part of my foolery that eludes me is, "How do I re-establish the /etc/resolv.conf symlink, so that box once again has outside internet access?"

I sit in a Tesla and translated this thread with Ai:

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.