Open jakubgs opened 1 year ago
Not sure I undestand the problem here. Some tools like wakucanary
and networkmonitor
use hardcoded dns values, so agree that a new flag for changing it would be nice to have.
But regarding wakunode2
don't see the problem. There are some default values, yes, but can be overiden by dnsDiscoveryNameServers
and dnsAddrsNameServers
. So no action here I guess? Or what do you mean by "Entirely avoiding local DNS settings ...". How can we use these local DNS settings besides using the mentioned flags?
not sure about the meme/image though. wouldn't like this to create precedent and end up having the repo full of them.
In general whatever the default on the host is should be used:
admin@node-01.do-ams3.wakuv2.prod:~ % grep -v '^#' /etc/resolv.conf
nameserver 127.0.0.53
options edns0 trust-ad
search .
Providing an explicit nameserver option or cli flag is not something that's a common practice, but is fine as long as the default is to use what the system uses.
Any news on this?
I suggest looking at this issue once we move from ValidIpAddress
(type deprecated currently) to IpAdress
to avoid conflicts.
Thereafter, we would need to apply something like the following, for Linux environments (need to check for Windows and MacOS)
import os
proc getDNSServers(): seq[string] =
var dnsServers: seq[string] = @[]
let resolvConf = "/etc/resolv.conf"
if existsFile(resolvConf):
let resolvContent = readFile(resolvConf)
for line in resolvContent.splitLines():
if line.strip.startswith("nameserver"):
let parts = line.strip.split(' ')
if parts.len >= 2:
dnsServers.add(parts[1])
return dnsServers
( cc @jakubgs )
Do we really need special logic for this? Don't calls like getaddrinfo
or gethostbyname
(deprecated) already use system DNS by default by reading /etc/resolv.conf
? Seems like overcomplicating it to me.
Problem
Impact
People configure DNS servers on their machines and networks for a reason. Entirely avoiding local DNS settings is a bad practice and should be avoided.