Losing DNS Name Resolution
Forum rules
Before you post read how to get help. Topics in this forum are automatically closed 6 months after creation.
Before you post read how to get help. Topics in this forum are automatically closed 6 months after creation.
Losing DNS Name Resolution
Good Morning
Since latest upgrade my system keeps losing DNS resolution setting and revert to 127.0.0.2 every single time this happens on all networks both LAN and WLAN. The network aint a problem at all because it works with everything else. You can ping google but you cannot get internet. After every reboot I have to apply the following to get internet through: (Small guide I compiled after a lot of trial and error)
Make sure your DNS Resolver config is writeable:
* sudo chmod o+r /etc/resolv.conf
Temporarily change DNS to use Google's nameserver:
* sudo nano /etc/resolv.conf
Change IP to 8.8.8.8
CTRL+O to write out file.
CTRL+X to exit
Since latest upgrade my system keeps losing DNS resolution setting and revert to 127.0.0.2 every single time this happens on all networks both LAN and WLAN. The network aint a problem at all because it works with everything else. You can ping google but you cannot get internet. After every reboot I have to apply the following to get internet through: (Small guide I compiled after a lot of trial and error)
Make sure your DNS Resolver config is writeable:
* sudo chmod o+r /etc/resolv.conf
Temporarily change DNS to use Google's nameserver:
* sudo nano /etc/resolv.conf
Change IP to 8.8.8.8
CTRL+O to write out file.
CTRL+X to exit
Last edited by LockBot on Wed Dec 28, 2022 7:16 am, edited 1 time in total.
Reason: Topic automatically closed 6 months after creation. New replies are no longer allowed.
Reason: Topic automatically closed 6 months after creation. New replies are no longer allowed.
Re: Losing DNS Name Resolution
You can make a script to the
/etc/rc.local
file for automating your commands.Re: Losing DNS Name Resolution
Newbie question, how would I go about making a script for automating this? Also, is this a known problem?administrollaattori wrote: ⤴Thu Mar 08, 2018 5:17 pm You can make a script to the/etc/rc.local
file for automating your commands.
Re: Losing DNS Name Resolution
Add the next line before the lastAskey307 wrote: ⤴Fri Mar 09, 2018 2:42 amNewbie question, how would I go about making a script for automating this? Also, is this a known problem?administrollaattori wrote: ⤴Thu Mar 08, 2018 5:17 pm You can make a script to the/etc/rc.local
file for automating your commands.
exit 0
into /etc/rc.local
file.
Code: Select all
sleep 10 && sed -i 'd;4d' /etc/resolv.conf && echo "nameserver 8.8.8.8" >> /etc/resolv.conf
/etc/rc.local
can be edited using nano.
Code: Select all
sudo nano /etc/rc.local
Re: Losing DNS Name Resolution
administrollaattori wrote: ⤴Fri Mar 09, 2018 6:20 amAdd the next line before the lastAskey307 wrote: ⤴Fri Mar 09, 2018 2:42 amNewbie question, how would I go about making a script for automating this? Also, is this a known problem?administrollaattori wrote: ⤴Thu Mar 08, 2018 5:17 pm You can make a script to the/etc/rc.local
file for automating your commands.exit 0
into/etc/rc.local
file.Code: Select all
sleep 10 && sed -i 'd;4d' /etc/resolv.conf && echo "nameserver 8.8.8.8" >> /etc/resolv.conf
/etc/rc.local
can be edited using nano.Code: Select all
sudo nano /etc/rc.local
That is super thank you mate. I'll give it a shot and if it works, i'll mark your post as the answer.
Re: Losing DNS Name Resolution
Hey mateadministrollaattori wrote: ⤴Fri Mar 09, 2018 6:20 amAdd the next line before the lastAskey307 wrote: ⤴Fri Mar 09, 2018 2:42 amNewbie question, how would I go about making a script for automating this? Also, is this a known problem?administrollaattori wrote: ⤴Thu Mar 08, 2018 5:17 pm You can make a script to the/etc/rc.local
file for automating your commands.exit 0
into/etc/rc.local
file.Code: Select all
sleep 10 && sed -i 'd;4d' /etc/resolv.conf && echo "nameserver 8.8.8.8" >> /etc/resolv.conf
/etc/rc.local
can be edited using nano.Code: Select all
sudo nano /etc/rc.local
Unfortunately no use. It keeps it for 3 boot ups then I have to re-apply everything again. So far the best option seems to backup and re-install. But that is the easy road. I would like to dig deeper and get a better understanding of Linux underlying principles.
Any other suggestions? I've already backed up everything so digging ain't a risk for me.
Re: Losing DNS Name Resolution
Re: Losing DNS Name Resolution
administrollaattori wrote: ⤴Mon Mar 12, 2018 4:11 amMaybe the simplest way is the best way?
viewtopic.php?f=53&t=264925&p=1442631#p1442631
Natural for the human mind to over complicate things. Thank you mate. It works so far.
Re: Losing DNS Name Resolution
Happened again, I have to edit the resolv.conf file everytime after a reboot to resolve 8.8.8.8 or get internet. The input of 8.8.8.8 under network settings does no good anymore.