Skip to content
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

Add Connection-specific DNS Suffix for WSL2 reachable networks to resolv.conf #8522

Open
blami opened this issue Jun 17, 2022 · 3 comments
Open
Labels

Comments

@blami
Copy link

blami commented Jun 17, 2022

Is your feature request related to a problem? Please describe.
Currently there's some mangling done by (probably) Windows virtual switch/DNS resolver? Not all DNS queries that work with Windows work in WSL2. For what's not working usually helps if I just add that specific Connection-specific DNS Suffix as search SUFFIX and eventually any domains from connection DNS Search List to /etc/resolv.conf.

In situations where I can use e.g. ping host on Windows I need to use ping host.fully.qualified.domain.name in WSL2 which is sometimes annoying.

Describe the solution you'd like
I'd like if init (or even better; some Windows side thing when connectivity changes re-) generated /etc/resolv.conf so that all known DNS lookup suffixes are automatically added as search stanzas. Maybe this could be sub-option of whether or not to generate resolv.conf.

Describe alternatives you've considered
Currently I am using simple script that is triggered by Windows Scheduler; Event type "Microsoft-Windows-NetworkProfile/Operational" and "Event Id" 1000. Script utilizes lame Powershell query to get suffixes:

Write-Host search @(Get-DnsClient | Select-Object -Property ConnectionSpecificSuffix | Where-Object {\$_.ConnectionSpecificSuffix -ne \"\"} | %{\$_.ConnectionSpecificSuffix})")

Additional context
I believe if WSL has access to network it should behave same (in terms of DNS resolver and other aspects) as host OS.

@blami blami added the feature label Jun 17, 2022
@phil-blain
Copy link

This looks like a duplicate of #701 (and #7453).

@blami
Copy link
Author

blami commented Jun 24, 2022

@phil-blain I saw both #701 and #7453 but somehow didn't read all the comments and thought it is about secondary suffixes (my DHCP server doesn't add them, serves just primary suffix).

@lexios
Copy link

lexios commented Dec 9, 2022

Our development team does not always use FQDNs so, the resolv.conf autogeneration should possibly copy over the physical adapter DHCP provided domain search lists.
Alternatively, wsl.conf should provide means to configure search domains for DNS.

DNS is very important so having as many options available via wsl.conf would be awsome.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants