mirror of
https://github.com/mageddo/dns-proxy-server.git
synced 2026-04-26 01:45:59 +03:00
[GH-ISSUE #386] Option to not comment out existing nameservers from resolv.conf #133
Labels
No labels
bug
confirmed
discussion
duplicate
enhancement
feature
feature-request
not-planned
pull-request
secondary-feature
stale
triage
waiting-feedback
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/dns-proxy-server-mageddo#133
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @Sajito on GitHub (Mar 20, 2023).
Original GitHub issue: https://github.com/mageddo/dns-proxy-server/issues/386
Originally assigned to: @mageddo on GitHub.
What is expected
I'd like to ask for an option, to disable the behavior of disabling existing nameservers. If that option is enabled, it should simply add itself without disabling the other options.
What is Happening
Currently when dps is started and the file "/etc/resolv.conf" is used, it will comment out any existing nameserver and add itself as single nameserver to the file.
What I want to achieve
When using my networks dns I can reach other devices in the same network by their hostname. When using dps locally, this ability gets lost.
I could add my networks dns to the "remoteDnsServers" list, but as I'm often in different networks, I'd have to always add the new dns ip addresses to that list.
This should simply work when adding dps as first nameserver in the resolv.conf without disabling all other nameservers.
@mageddo commented on GitHub (Mar 21, 2023):
Sounds good to me, would you prefer to do the configuration by command line, json or env?
@Sajito commented on GitHub (Mar 21, 2023):
I like to use the json, so I'd prefer the option there
@mageddo commented on GitHub (Mar 22, 2023):
This feature will depends on #392 otherwise won't work as expected
@Sajito commented on GitHub (Mar 23, 2023):
I think when we have this option, it is enabled and there is at least one other nameserver in the resolv.conf, then dps maybe should not use the remote solver, as it should be handled by the other nameservers. What do you think?
@mageddo commented on GitHub (Mar 23, 2023):
I would add a specific option for that, introduce
--no-remote-servers.@Sajito commented on GitHub (Mar 23, 2023):
Sounds good for me 👍
@mageddo commented on GitHub (Apr 5, 2023):
Just released
3.15.10-snapshotsee the docs for the new optionresolvConfOverrideNameServers. No remote servers option will be released in the sequence.@mageddo commented on GitHub (Apr 7, 2023):
Finally released
3.15.11-snapshotsee the docs for the new option (No Remote Servers).Can you check the released features? Then we can close this issue @Sajito.
@Sajito commented on GitHub (Apr 7, 2023):
I've tested both features using this docker-compose config. I know the MG_RESOLVCONF is not needed, as it's detected automatically. But since my system uses systemd-resolved, it would be required to restart the systemd-resolved service. Using the /etc/resolv.conf directly does not require the system restart.
The
NO_REMOTE_SERVERSenvironment variable does not seem to work. When adding only that variable, remote servers are still used. When using the cli option, it works fine.The two features work as requested, but unfortunately the intended use-case still does not work. In fact, using both features together results in no external domains being resolved.
From my understanding that's the case, because DPS returns
NXDOMAIN, when it has no result.NXDOMAINfrom any nameserver causes the clients to stop trying any other nameserver (see https://superuser.com/a/1713739).I'm not sure, but maybe returning
SERVFAILinstead ofNXDOMAINmight work? But that's really only an uneducated guess.@mageddo commented on GitHub (Apr 8, 2023):
The docs are incorrect, the right variable name is
MG_NO_REMOTE_SERVERS@mageddo commented on GitHub (Apr 8, 2023):
I've tried, REFUSED and SERVFAIL, only SERVFAIL worked:
I don't consider return
SERVFAILas a RFC compliant answer in that case, for that reason I'll customize the RCODE when a hostname wasn't found by DPS local solvers (not the remote ones), I consider it must solve your use case.@mageddo commented on GitHub (Apr 12, 2023):
By #414 I'm releasing
3.15.13-snapshot, will be available in 10 minutes. @Sajito@Sajito commented on GitHub (Apr 13, 2023):
This is awesome, it's working perfectly fine. Thank you very much!