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

Set DNS resolver options in autogenerated resolver configuration #11385

Open
olliefr opened this issue Mar 27, 2024 · 5 comments
Open

Set DNS resolver options in autogenerated resolver configuration #11385

olliefr opened this issue Mar 27, 2024 · 5 comments
Labels

Comments

@olliefr
Copy link

olliefr commented Mar 27, 2024

Is your feature request related to a problem? Please describe.
I would like to configure the timeout and the retry attempts for a DNS resolver which is using autogenerated /etc/resolver.conf.

Describe the solution you'd like
I suppose that an extra parameter for wsl.conf section network would solve this.

It could be named resolvConfOptions and its type would be string.

The value would be added to the autogenerated /etc/resolv.conf as options ...

Example wsl.conf:

[network]
generateResolvConf = true
resolvConfOptions = "timeout:1 attempts:3"

This would produce the following example /etc/resolv.conf:

# This file was automatically generated by WSL. To stop automatic generation of this file, add the following entry to /etc/wsl.conf:
# [network]
# generateResolvConf = false

# ... nameserver, search, etc here

options timeout:1 attempts:3

Describe alternatives you've considered
To the best of my knowledge, the only alternative at the moment is to turn off auto-generation and manage /etc/resolv.conf manually. This does not sound appealing as network settings and DNS server addresses do change.

Copy link

Logs are required for review from WSL team

If this a feature request, please reply with '/feature'. If this is a question, reply with '/question'.
Otherwise please attach logs by following the instructions below, your issue will not be reviewed unless they are added. These logs will help us understand what is going on in your machine.

How to collect WSL logs

Download and execute collect-wsl-logs.ps1 in an administrative powershell prompt:

Invoke-WebRequest -UseBasicParsing "https://raw.githubusercontent.com/microsoft/WSL/master/diagnostics/collect-wsl-logs.ps1" -OutFile collect-wsl-logs.ps1
Set-ExecutionPolicy Bypass -Scope Process -Force
.\collect-wsl-logs.ps1

The scipt will output the path of the log file once done.

Once completed please upload the output files to this Github issue.

Click here for more info on logging
If you choose to email these logs instead of attaching to the bug, please send them to [email protected] with the number of the github issue in the subject, and in the message a link to your comment in the github issue and reply with '/emailed-logs'.

View similar issues

Please view the issues below to see if they solve your problem, and if the issue describes your problem please consider closing this one and thumbs upping the other issue to help us prioritize it!

Closed similar issues:

Note: You can give me feedback by thumbs upping or thumbs downing this comment.

@olliefr
Copy link
Author

olliefr commented Mar 27, 2024

/feature

Copy link

Diagnostic information
Found '/feature', adding tag 'feature'

@zcobol
Copy link

zcobol commented Mar 28, 2024

@olliefr resolve.h has very sane defaults, i.e. RES_TIMEOUT set to 5 sec. Do you really want to change it to 1 sec? Your resolver might miss a lot of responses!

@olliefr
Copy link
Author

olliefr commented Mar 28, 2024

Do you really want to change it to 1 sec?

Yes, I do 😈

Your resolver might miss a lot of responses!

I'll fire it and get a better one, then! 😉

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

2 participants