-
Notifications
You must be signed in to change notification settings - Fork 822
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
WSL2: resolver ignores LOCALDOMAIN env variable #7328
Comments
For WSL2 the DNS resolver runs on the host, so the Linux environment variables will not be respected. |
Thanks for responding. So this will remain "working as intended"? Guess I'll hack up a file watcher or cron job to camp on /etc/resolv.conf. |
You can |
This issue has been automatically closed since it has not had any activity for the past year. If you're still experiencing this issue please re-file this as a new issue or feature request. Thank you! |
Windows Build Number
Microsoft Windows [Version 10.0.18363.1621]
WSL Version
Kernel Version
Linux version 5.10.43.3-microsoft-standard-WSL2 (oe-user@oe-host) (x86_64-msft-linux-gcc (GCC) 9.3.0, GNU ld (GNU Binutils) 2.34.0.20200220) #1 SMP Wed Jun 16 23:47:55 UTC 2021
Distro Version
CentOS Linux release 7.9.2009 (Core)
Other Software
Not applicable.
Repro Steps
Expected Behavior
resolver seems to be ignoring environment variables.
On RHEL 7.9, setting LOCALDOMAIN overrides any search directive in /etc/resolv.conf. This is documented in the man pages (
man resolv.conf
):The search keyword of a system's resolv.conf file can be overridden on a per-process basis by setting the environment variable LOCALDOMAIN to a space-separated list of search domains.
generateResolvConf = false
because my IP address changes.Actual Behavior
resolver fails unless there is a domain or search directive containing the proper domain. Adding a LOCALDOMAIN environment variable does not fix the problem.
Diagnostic Logs
I have created a GIST with the output of
strace nslookup host.example.com
and
LOCALDOMAIN="domainB.example.com" strace nslookup host.example.com
.To my casual inspection they look identical.
The text was updated successfully, but these errors were encountered: