Keep losing nameserver on ubuntu 22.04

153 views
Skip to first unread message

bgra...@umw.edu

unread,
Dec 15, 2023, 7:54:06 AM12/15/23
to weewx-user
Hello,
Weewx 4.10.2 has been running fine but suddenly stopped FTPing to the main site. After checking, I found that my dns servers were missing. After putting them back, it ran normally for a few hours and then FTP stopped again because dns had disappeared. Not sure what is happening here as weewx is running fine. Resolv.conf seems to be a simlink to something else and can’t be edited. Using webmin to reset the dns servers only works for a short while.
I realize this probably isn’t a weewx problem but I’m completely stumped as to how to fix the problem. Any help or suggestions would be greatly appreciated. Thanks in advance.
Cheers,
Bob

WindnFog

unread,
Dec 15, 2023, 9:48:22 AM12/15/23
to weewx-user
I wouldn't touch /etc/resolv.conf as the O/S manages this.  I use the Ubuntu Gnome GUI to set my DNS servers. Under the network icon on the top left, select Settings and beside "Wired," again, pick Settings.  I pick the IPv4 tab and select Manual . . . I'm using a static IP on my LAN.  At the bottom, there is a DNS slot.  Turn off Automatic and put in your DNS servers separated by commas. Use the DNS servers your ISP specifies, or go with proven public ones like Google (8.8.8.8. 8.8.4.4), Cloudflare (1.1.1.1, 1.0.0.1), OpenDNS (208.67.222.222, 208.67.220.220), etc.

I don't see how weeWX could be changing these. It's almost certainly a Ubuntu issue.

cric...@pobox.com

unread,
Dec 16, 2023, 4:14:45 PM12/16/23
to weewx-user
I get tired of trying to figure out all the various ways /etc/resolve.conf can get modified, for all my static hosts,
if it's a link, I replace it with the file with the contents I want, then run:
chattr +i /etc/resolve/conf
That prevents any further messing with the file.  It does mean you are on the hook for any needed updates.
The alternative is figuring out who (which process(es)) is maintaining the file and get the configs to those files
straightened out.  I manage my own DNS and DHCP servers so I know what resolve.conf needs to have, but the
various OS's drive me nuts, so I remove their ability to screw things up.

Chris

Cameron D

unread,
Dec 17, 2023, 8:50:15 AM12/17/23
to weewx-user
yes, definitely not a weeex problem.
You have not given us anything to go on, as there are  dozens of combinations of installations that will influence this.  For example  "Resolv.conf seems to be a simlink to something else" is about as vague as you can possibly get.

  1. When you say "my dns servers" do you really mean you are running local DNS servers?, or do you mean ... "the external DNS servers my system needs to use."?
  2. check out the documentation for systemd-resolved - it sounds like you are using this systemd utility.  There are many ways to operate it
  3. if you remove the symlink at /etc/resolv.conf and replace with a text file the information you want then systemd should leave it alone and assume you are managing everything.
  4. are you running dhcp to give out details to your weewx system?  the dhcp client will want to update DNS server details and needs to be compatible with however your resolver operates.
Your best bet is to google for some guides, however be aware that  some will not be correct if they don't match your networking/server setup.

bgra...@umw.edu

unread,
Dec 17, 2023, 10:44:15 AM12/17/23
to weewx-user
Thanks, Cameron D, for the suggestions. Sorry to have been so vague, I guess was in a panic situation. 
My problem was finally solved by forcing a reinstall of resolvconf which seemed to put everything back in proper order. Messing with /etc/resolv.conf  (as in the old days) didn't work for me as it was being overwritten. 
For anyone with a limited knowledge of Ubuntu/Debian, such as myself, I found an excellent link to setting DNS, etc.

Cheers,
Bob

Reply all
Reply to author
Forward
0 new messages