Forums

Skip to content

Advanced search
  • Quick links
    • Unanswered topics
    • Active topics
    • Search
  • FAQ
  • Login
  • Register
  • Board index Assistance Networking & Security
  • Search

MISTAKE: "nameserver 0.0.0.0" added to resolv.conf

Having problems getting connected to the internet or running a server? Wondering about securing your box? Ask here.
Post Reply
Advanced search
14 posts • Page 1 of 1
Author
Message
VinzC
Watchman
Watchman
User avatar
Posts: 5100
Joined: Sat Apr 17, 2004 1:51 pm
Location: Dark side of the mood

MISTAKE: "nameserver 0.0.0.0" added to resolv.conf

  • Quote

Post by VinzC » Thu Aug 01, 2019 4:05 pm

Hi all.

I've just realized why my laptop has been very slow to show pages or bring up network connections for a long time already. The issue is due to this line in /etc/resolv.conf:

Code: Select all

nameserver 0.0.0.0
I feel dumb because I have exactly no idea why this line comes popping up in that file. Fact is it causes latencies because there's no DNS service listening locally... except when my virtual machine manager and virtual machines are running. But most of the time they're not and that line still pops in.

But even then dnsmasq is never listening to any of my interfaces other than the virtual bridges. Its global configuration file is even empty. It's not even running and is not part of any of OpenRC runlevels.

I suspected my home router (Archer C2) to send buggy DNS options but then I checked and changed the line that said "0.0.0.0" (although it's mentioned "optional") to "1.1.1.1" (just to see what happens). Unfortunately it didn't change anything as to my resolver file.

Although I'm suspecting dhcpcd adds that line to the file I'm actually not sure it does directly update the file and not one of its hooks or a hidden, unsuspected resolver. As for resolvers I have none that I consciously installed (i.e. openresolv). I don't have any VPN either.

Anyway everytime I force dhcpcd to renew its leases (dhcpcd -N) the spurious nameserver line comes back.

Here's dhcpcd configuration file

Code: Select all

hostname
duid
persistent
option rapid_commit
option domain_name_servers, domain_name, domain_search, host_name
option classless_static_routes
option interface_mtu
require dhcp_server_identifier
slaac private
And here are the installed hooks, which, I believe are the defaults for I never did anything with them:

Code: Select all

total 12
-r--r--r-- 1 root root 2791 17 jun 21:28 10-wpa_supplicant
-r--r--r-- 1 root root  867 17 jun 21:28 15-timezone
-r--r--r-- 1 root root  796 17 jun 21:28 29-lookup-hostname
Can anyone help me track this issue down for a fix?

Thanks a lot in advance.
Last edited by VinzC on Thu Aug 01, 2019 6:43 pm, edited 1 time in total.
Gentoo addict: tomorrow I quit, I promise!... Just one more emerge...
1739!
Top
eccerr0r
Watchman
Watchman
Posts: 10239
Joined: Thu Jul 01, 2004 6:51 pm
Location: almost Mile High in the USA
Contact:
Contact eccerr0r
Website

  • Quote

Post by eccerr0r » Thu Aug 01, 2019 5:30 pm

I would still think it is coming from your dhcp server, but since you seem to have proved it otherwise, well, that can't be it.
Actually if it was coming from your DHCP server, all machines would also get the errant DNS entry - is this the case?

Looks like your dhcpcd.conf is pretty much stock...so that should be okay...
Intel Core i7 2700K/Radeon Firepro W2100/24GB DDR3/800GB SSD
What am I supposed watching?
Top
Anon-E-moose
Watchman
Watchman
User avatar
Posts: 6566
Joined: Fri May 23, 2008 7:31 pm
Location: Dallas area

  • Quote

Post by Anon-E-moose » Thu Aug 01, 2019 5:54 pm

you could try setting
nohook resolv.conf
in your dhcpcd.conf file to see if it would stop that.

ETA: https://wiki.archlinux.org/index.php/Do ... pcd_Config

ETA2: man 5 dhcpcd.conf will give some help, you can set static dns entries there, if it's what's changing your /etc/resolv.conf
Last edited by Anon-E-moose on Thu Aug 01, 2019 6:28 pm, edited 1 time in total.
UM780 xtx, 6.18 zen kernel, gcc 15, openrc, wayland
minixforum m1-s1 max -- same software as above but used for ai learning


Zealots are gonna be zealots, just like haters are gonna be haters
Top
VinzC
Watchman
Watchman
User avatar
Posts: 5100
Joined: Sat Apr 17, 2004 1:51 pm
Location: Dark side of the mood

  • Quote

Post by VinzC » Thu Aug 01, 2019 6:26 pm

eccerr0r wrote:I would still think it is coming from your dhcp server, but since you seem to have proved it otherwise, well, that can't be it.
Actually if it was coming from your DHCP server, all machines would also get the errant DNS entry - is this the case?
I have apparently installed a resolver on the other machine, which is fixed. So the configuration is pretty static. I might try to change it to a mobile profile... although I'm not sure to fail somwhere... I'll try and report anyway.
eccerr0r wrote:Looks like your dhcpcd.conf is pretty much stock...so that should be okay...
That's something worth knowing. At least I'm not yet crazy ;-) .
Gentoo addict: tomorrow I quit, I promise!... Just one more emerge...
1739!
Top
VinzC
Watchman
Watchman
User avatar
Posts: 5100
Joined: Sat Apr 17, 2004 1:51 pm
Location: Dark side of the mood

  • Quote

Post by VinzC » Thu Aug 01, 2019 6:32 pm

Anon-E-moose wrote:you could try setting
nohook resolv.conf
in your dhcpcd.conf file to see if it would stop that.
Well... of course it stopped adding the line — that's rad... But in the meantime if I leave it that way and change site, I'll lose name service resolution. What is to be deduced from this test?
Gentoo addict: tomorrow I quit, I promise!... Just one more emerge...
1739!
Top
VinzC
Watchman
Watchman
User avatar
Posts: 5100
Joined: Sat Apr 17, 2004 1:51 pm
Location: Dark side of the mood

  • Quote

Post by VinzC » Thu Aug 01, 2019 6:39 pm

eccerr0r wrote:I would still think it is coming from your dhcp server, but since you seem to have proved it otherwise, well, that can't be it.
:oops: Erm... I'm sorry, I think I've edited the wrong page on my router, i.e. the WAN instead of the LAN settings... I *really* feel dumb as I've happened to be much smarter than that. Sometimes...

Okay, I'm trying to update the DHCP settings on the LAN side. I'll report if there's anything new.

EDIT: That was it. Stupid human who configured the router probably missed something, maybe believed it's powered by dnsmasq or something. It's all right now. Will take my pills and go to bed.

Probably call the nurse. I may need one...
Gentoo addict: tomorrow I quit, I promise!... Just one more emerge...
1739!
Top
VinzC
Watchman
Watchman
User avatar
Posts: 5100
Joined: Sat Apr 17, 2004 1:51 pm
Location: Dark side of the mood

  • Quote

Post by VinzC » Thu Aug 01, 2019 6:54 pm

Joke apart, it was really tricky nevertheless. I'm no specialist on DHCP options and settings but when I see this:

Code: Select all

                      +------------------+
Default Domain:       |                  |  (optional)
                      +------------------+
                      +------------------+
DNS Server:           |                  |  (optional)
                      +------------------+
                      +------------------+
Secondary DNS Server: |                  |  (optional)
                      +------------------+
and when pressing "save" with nothing in those edit boxes makes those boxes show "0.0.0.0", far from me to believe this would cause issues! I've been having this router (TP-Link / Archer C2 inside) for years and it's only for a couple of months or even weeks that I started to see slowdowns. Maybe dhcpcd ignored those options — because, yes, they are sent with "0.0.0.0" although they're f****g optional!

I've had to edit both DNS lines and put the one and only IP of my router *sighs* . But at least the problem is gone.
Last edited by VinzC on Thu Aug 01, 2019 7:04 pm, edited 1 time in total.
Gentoo addict: tomorrow I quit, I promise!... Just one more emerge...
1739!
Top
Anon-E-moose
Watchman
Watchman
User avatar
Posts: 6566
Joined: Fri May 23, 2008 7:31 pm
Location: Dallas area

  • Quote

Post by Anon-E-moose » Thu Aug 01, 2019 6:58 pm

The 0.0.0.0 means for it to auto configure, it I'm not mistaken, at least as far as domain name settings.
But I'm not sure that's what you really want.
UM780 xtx, 6.18 zen kernel, gcc 15, openrc, wayland
minixforum m1-s1 max -- same software as above but used for ai learning


Zealots are gonna be zealots, just like haters are gonna be haters
Top
VinzC
Watchman
Watchman
User avatar
Posts: 5100
Joined: Sat Apr 17, 2004 1:51 pm
Location: Dark side of the mood

  • Quote

Post by VinzC » Thu Aug 01, 2019 7:07 pm

Anon-E-moose wrote:The 0.0.0.0 means for it to auto configure, it I'm not mistaken, at least as far as domain name settings.
But I'm not sure that's what you really want.
That is indeed what I understood. But that crap obviously sends those "0.0.0.0" out there (though, as I understand, it should not), confusing name resolution on my laptop. Writing nothing brings up those 0.0.0.0 by default so there's no way avoiding them but set both to the same value, although being obvious for the firmware. At least it *should*. Seems not.

Unless I'm deeply mistaken, of course.

Anyway, thanks a lot for helping.
Gentoo addict: tomorrow I quit, I promise!... Just one more emerge...
1739!
Top
alamahant
Advocate
Advocate
Posts: 4032
Joined: Sat Mar 23, 2019 12:12 pm

  • Quote

Post by alamahant » Fri Aug 02, 2019 2:15 pm

I am aware I am just a noob but maybe there are other daemons setting it?
systemd-resolved
systemd-networkd
(But I assume you are using openrc..)
resolvconf
Could you manually insert your desired nameserver and then maybe use something like

Code: Select all

chattr +iu /etc/resolv.conf
or some other kind of ACL to prevent it from being over-written?
Would that work?
Top
Hu
Administrator
Administrator
Posts: 24386
Joined: Tue Mar 06, 2007 5:38 am

  • Quote

Post by Hu » Sat Aug 03, 2019 12:32 am

It might work, but it is the wrong solution. Please do not advise users to use the immutable bit without also warning them about the consequences.

If the DHCP server cannot be trusted to send sane DNS servers, then the clients should be told to ignore the DHCP server's suggested DNS servers.
Top
alamahant
Advocate
Advocate
Posts: 4032
Joined: Sat Mar 23, 2019 12:12 pm

  • Quote

Post by alamahant » Sat Aug 03, 2019 8:56 am

Hu kindly forgive me.
Maybe you can try to install networkmanager and create a static config.
Something like
nmcli .............. ipv4.dns <> ipv4.method manual
Then disable dhcpcd.
Nobody fools with networkmanager.
It is very precise and always works as it should
Or if it comes from your router maybe disable the dhcp server of your router and install your own dnsmasq or dhcp.
Top
UberLord
Retired Dev
Retired Dev
User avatar
Posts: 6838
Joined: Thu Sep 18, 2003 10:26 am
Location: Blighty
Contact:
Contact UberLord
Website

  • Quote

Post by UberLord » Mon Aug 05, 2019 2:01 am

alamahant wrote:Hu kindly forgive me.
Maybe you can try to install networkmanager and create a static config.
Something like
nmcli .............. ipv4.dns <> ipv4.method manual
Then disable dhcpcd.
Nobody fools with networkmanager.
It is very precise and always works as it should
Or if it comes from your router maybe disable the dhcp server of your router and install your own dnsmasq or dhcp.
1) VinzC already said it was a mistake with his DHCP config.
2) He wants to use DHCP, not a static config. This doesn't help.
3) As he wants DHCP pretty sure manual is way out as well.
4) I won't stop anyone disablig dhcpcd, unsure how that helps with a misconfigured DHCP server, but whatever.
5) *
6) It's only as precise as what the network topology advertises
7) Guessing English is not your first language.

Anyway, 5) * - Nobody fools with networkmanager.
A quick grep of NetworkManager on github shows no hits for INADDR_ANY or 0.0.0.0 with regards to DNS so I'll willing to bet that it's just as susceptable to DHCP config error as the next man.

And as the author of not one but *two* downstream packages NetworkManager purports to support (+), NetworkManager just lies.
(+) https://www.linuxquestions.org/question ... 175574300/
dhcpcd has supported IPv6 and DHCPv6 since dhcpcd-5, reporter has dhcpcd-6 installed. Also, dhcpcd supported IPv6 before NetworkManager.
To-date, NM still reports the same lying error.

(+) No link, but NM claims to support resolvconf. Support is tenuous at best - basically NM merges what it knows about into one file which it presents to resolvconf.
This infact breaks the very thing resolvconf was designed to support - VPN DNS:
https://roy.marples.name/projects/openresolv
What is amusing is that to date, NM still can't manange a resolv.conf file (or other resolvers) in this way.

NetworkManger sure fools a lot of people but it doesn't fool me. Sure I have an extreme bias, but equally my software neither lies nor presents a view to deliberately break other components.

Guessing that NetworkManager has sure fooled you!
Use dhcpcd for all your automated network configuration needs
Use dhcpcd-ui (GTK+/Qt) as your System Tray Network tool
Top
VinzC
Watchman
Watchman
User avatar
Posts: 5100
Joined: Sat Apr 17, 2004 1:51 pm
Location: Dark side of the mood

  • Quote

Post by VinzC » Tue Sep 10, 2019 9:32 am

Hi Roy. Nice to read from you 8) .
UberLord wrote:Guessing that NetworkManager has sure fooled you!
Bwahahaha :lol:

You made my day!

@alamahant:

One of the things I learnt in all those years using Gentoo is to recognize software to trust. And quite frankly dhcpcd is probably one of the most trustworthy tools on this platform — yup, I'm probably biased, too. I like to cut the crap from my platform so no systemd, no network manager. Amongst others.

When you trust your network stack, you don't have to feel the urge to interact with it from your desktop environment: it will do its job and be silent about it when everything is fine. In short: don't fiddle with it unless absolutely necessary. That's what dhcpcd does. You have su or sudo whenever there's a problem — yeah, become a sys admin when there are sys admin responsibilities to endorse, what's wrong with that.

How many times do I have to touch my network configuration? Only when I change to a new, unregistered place... *and* there's no RJ45! It generally takes longer to ask the local network admins for authorizations than setup the network by hand...

This use case is no different: not the tool was the problem. *I* was (at least for buying such a unreliable, cheapo, crappy router).

It's totally flabbergasting to see such a tremendous amount of work for a tool (say: NM), which job is basically to sit there and do absolutely *nothing* that the operating system can't do. It's about adding lines of code, hence bugs, for the sole purpose of having an icon somewhere that just brings nothing of truly added value. No thanks.

Be root when you need to, damn'it :wink: ! That's how you understand and talk to your system.

EDIT: I realize NM developers might take offence on what I said. Well... you'll be fine.
Gentoo addict: tomorrow I quit, I promise!... Just one more emerge...
1739!
Top
Post Reply

14 posts • Page 1 of 1

Return to “Networking & Security”

Jump to
  • Assistance
  • ↳   News & Announcements
  • ↳   Frequently Asked Questions
  • ↳   Installing Gentoo
  • ↳   Multimedia
  • ↳   Desktop Environments
  • ↳   Networking & Security
  • ↳   Kernel & Hardware
  • ↳   Portage & Programming
  • ↳   Gamers & Players
  • ↳   Other Things Gentoo
  • ↳   Unsupported Software
  • Discussion & Documentation
  • ↳   Documentation, Tips & Tricks
  • ↳   Gentoo Chat
  • ↳   Gentoo Forums Feedback
  • ↳   Duplicate Threads
  • International Gentoo Users
  • ↳   中文 (Chinese)
  • ↳   Dutch
  • ↳   Finnish
  • ↳   French
  • ↳   Deutsches Forum (German)
  • ↳   Diskussionsforum
  • ↳   Deutsche Dokumentation
  • ↳   Greek
  • ↳   Forum italiano (Italian)
  • ↳   Forum di discussione italiano
  • ↳   Risorse italiane (documentazione e tools)
  • ↳   Polskie forum (Polish)
  • ↳   Instalacja i sprzęt
  • ↳   Polish OTW
  • ↳   Portuguese
  • ↳   Documentação, Ferramentas e Dicas
  • ↳   Russian
  • ↳   Scandinavian
  • ↳   Spanish
  • ↳   Other Languages
  • Architectures & Platforms
  • ↳   Gentoo on ARM
  • ↳   Gentoo on PPC
  • ↳   Gentoo on Sparc
  • ↳   Gentoo on Alternative Architectures
  • ↳   Gentoo on AMD64
  • ↳   Gentoo for Mac OS X (Portage for Mac OS X)
  • Board index
  • All times are UTC
  • Delete cookies

© 2001–2026 Gentoo Foundation, Inc.

Powered by phpBB® Forum Software © phpBB Limited

Privacy Policy

 

 

magic