Set DNS resolver options in autogenerated resolver configuration
Nobody has claimed this yet.
- Dominant language
- C++
- Stars
- 33.7k
- Forks
- 1.8k
- Avg merge
- 3d 17h
- Merged PRs (30d)
- 116
Description
**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`:
```ini
[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.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by locating how the [network] section of wsl.conf is parsed and how autogenerated /etc/resolv.conf content is produced. Check any existing configuration or resolver-generation tests; done means the new option is accepted and its value appears as an options line in the generated file.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- cpp
- Domain
- networking
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100