Ability to configure domain name from wsl.conf
- Dominant language
- C++
- Stars
- 33.7k
- Forks
- 1.8k
- Avg merge
- 3d 17h
- Merged PRs (30d)
- 116
Description
### Windows Version
Microsoft Windows [version 10.0.22621.3593]
### WSL Version
1.2.5.0
### Are you using WSL 1 or WSL 2?
- [X] WSL 2
- [ ] WSL 1
### Kernel Version
5.15.90.1
### Distro Version
Ubuntu 22.04
### Other Software
_No response_
### Repro Steps
If `generateResolvConf` is false, I can configure the company's domain manually in `/etc/resolv.conf`.
However, with such a configuration, it is more difficult to retrieve the WSL gateway IP address, ex
`NEW_IP=$(grep -m 1 nameserver /etc/resolv.conf | awk '{print $2}')`.
As a workaround, one can use:
`netstat -rn | grep "^0.0.0.0" | awk '{print $2}'`
### Expected Behavior
1. I would like to enable my company's domain in WSL to be able to ping internal servers without having to specify the domain name every time.
2. I would like to access windows host easily from WSL (using a DNS name), ex windows-host.
### Actual Behavior
When `generateResolvConf` is true, WSL ignores my company's domain, thus I cannot ping servers of my network without specifying the domain (ex: `ping mygitserver.MY.COMPANY`).
### Diagnostic Logs
_No response_
Contributor guide
Research direction
Start by reproducing the WSL 2 behavior with generateResolvConf enabled and compare /etc/resolv.conf with the manual configuration described in the issue. Trace how wsl.conf settings and resolv.conf generation are handled, then verify that a configured search domain and a DNS name for the Windows host work without manual gateway discovery.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- cpp, ubuntu
- Domain
- networking, operating-systems
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100