Comments (7)
@lucastheisen, glad to hear the scenario works now
thanks for pointing out that dns tunneling stills shows as disabled by default in the docs - will get that fixed. 2.2.4 is the first release build where we have this enabled by default
I also plan to add documentation notes to mention the Windows hosts file is not copied in Linux and that generateResolvConf needs to be true when DNS tunneling is enabled
thanks for your feedback!
from wsl.
hello @lucastheisen . thanks for reporting this.
I see you are using the 2.2.4 build, which has dnsTunneling enabled by default. When dnsTunneling is enabled, the Windows hosts file is not copied to the Linux hosts file, because Linux DNS queries are proxied to Windows and Windows DNS settings, including Windows hosts file are already applied to those queries.
To confirm, you can try running dig test.local in Linux and we would expect it to return 127.127.127.127
from wsl.
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:
- /etc/hosts file was overwritten by WSL at some point (#3043), similarity score: 0.71
- generateResolvConf = false doesn't work (#7816), similarity score: 0.70
- /etc/hosts does not update (#2059), similarity score: 0.70
Note: You can give me feedback by thumbs upping or thumbs downing this comment.
from wsl.
/emailed-logs
from wsl.
Diagnostic information
Found '/emailed-logs', adding tag 'emailed-logs'
from wsl.
@CatalinFetoiu , when i run dig test.local
i dont get back my 127.127.127.127
as i expect:
(wsl-rocky9) ltheisen@PC ~
$ dig test.local
; <<>> DiG 9.16.23-RH <<>> test.local
;; global options: +cmd
;; Got answer:
;; WARNING: .local is reserved for Multicast DNS
;; You are currently testing what happens when an mDNS query is leaked to DNS
;; ->>HEADER<<- opcode: QUERY, status: NXDOMAIN, id: 55406
;; flags: qr rd ra; QUERY: 1, ANSWER: 0, AUTHORITY: 1, ADDITIONAL: 1
;; OPT PSEUDOSECTION:
; EDNS: version: 0, flags:; udp: 1220
; COOKIE: a3aabcb13eac55f5e00b0b68667580ddf31c7bf9f3019eb8 (good)
;; QUESTION SECTION:
;test.local. IN A
;; AUTHORITY SECTION:
. 10800 IN SOA a.root-servers.net. nstld.verisign-grs.com. 2024062100 1800 900 604800 86400
;; Query time: 90 msec
;; SERVER: 10.20.100.53#53(10.20.100.53)
;; WHEN: Fri Jun 21 09:32:13 EDT 2024
;; MSG SIZE rcvd: 142
And just for clarity:
(wsl-rocky9) ltheisen@PC ~
$ cat /mnt/c/Windows/System32/drivers/etc/hosts
# Copyright (c) 1993-2009 Microsoft Corp.
#
# This is a sample HOSTS file used by Microsoft TCP/IP for Windows.
#
# This file contains the mappings of IP addresses to host names. Each
# entry should be kept on an individual line. The IP address should
# be placed in the first column followed by the corresponding host name.
# The IP address and the host name should be separated by at least one
# space.
#
# Additionally, comments (such as these) may be inserted on individual
# lines or following the machine name denoted by a '#' symbol.
#
# For example:
#
# 102.54.94.97 rhino.acme.com # source server
# 38.25.63.10 x.acme.com # x client host
# localhost name resolution is handled within DNS itself.
# 127.0.0.1 localhost
# ::1 localhost
127.127.127.127 test.local
... using the 2.2.4 build, which has dnsTunneling enabled by default
The documentation says it is false
by default, and i do not have it explicitly set in my configuration. Is there a way to see what the runtime value of all the configuration options is given that the documentation clearly does not agree with your assertion that it is true
by default? Also, this just recently stopped working (we just noticed yesterday, and the last i can guarantee it was working was about a month ago), is this change that recent?
Also, is there some documentation on this dnsTunneling
that could explain how it interoperates with entries in C:\Windows\System32\drivers\etc\hosts
? Regular DNS does not do resolution of /etc/hosts
entries, you need your nsswitch.conf
to include files
to get it to look at hosts.
I am struggling to understand what the expected behavior is here and how i can have my own hosts file, or similar feature, that will resolve my local aliases....
from wsl.
@CatalinFetoiu , i think i found the problem. We were also doing:
[network]
generateResolvConf = false
And my guess is that you need to generate a nameserver
entry to point to the dns tunnel. And after switching that to true
, and a handy wsl.exe --shutdown
i now get the response you indicated i should expect:
(wsl-rocky9) ltheisen@PC ~
$ cat /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 10.255.255.254
search LUCASTHEISEN.COM lucastheisen.home
(wsl-rocky9) ltheisen@PC ~
$ dig test.local
; <<>> DiG 9.16.23-RH <<>> test.local
;; global options: +cmd
;; Got answer:
;; WARNING: .local is reserved for Multicast DNS
;; You are currently testing what happens when an mDNS query is leaked to DNS
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 33790
;; flags: qr aa rd ad; QUERY: 1, ANSWER: 1, AUTHORITY: 0, ADDITIONAL: 1
;; WARNING: recursion requested but not available
;; OPT PSEUDOSECTION:
; EDNS: version: 0, flags:; udp: 4096
;; QUESTION SECTION:
;test.local. IN A
;; ANSWER SECTION:
test.local. 254050 IN A 127.127.127.127
;; Query time: 0 msec
;; SERVER: 10.255.255.254#53(10.255.255.254)
;; WHEN: Fri Jun 21 10:39:31 EDT 2024
;; MSG SIZE rcvd: 65
Can you confirm that these settings are indeed intertwined? Is there a place i could submit an MR to the documentation that would indicate this relationship for future reference?
Also, feel free to close this issue if my assertions here are correct...
from wsl.
Related Issues (20)
- Issue using iptables with 6.6.36-lts kernel HOT 12
- WSL2 gets laggy over time - suspend to disk (hibernate) restores normal operation HOT 9
- I can't seem to get 6.6.36.3-lts to boot when building without module support HOT 5
- NVIDIA-SMI couldn't find libnvidia-ml.so library in your system HOT 2
- WSL stopped working - hangs for any distro access HOT 2
- WSL Installation Issue Leading to PC Boot Failure HOT 6
- Can't attach disk HOT 1
- wsl not responding just saying class not registered HOT 5
- Error code: Wsl/0x80080005 - The Windows Subsystem for Linux optional component is not enabled. Please enable it and try again. HOT 8
- WslRegisterDistribution failed with error: 0x80040321 HOT 4
- The installation process for distribution 'Ubuntu' failed with exit code: 1. Error code: Wsl/InstallDistro/WSL_E_INSTALL_PROCESS_FAILED HOT 3
- WSL installation fails with error "0x8007019e" plus "wsl -l -v" gives an error "Wsl/0x80080005" HOT 6
- Mirrored networking mode is not supported, falling back to NAT networking HOT 3
- USBIPD broken by latest WSL pre-release version HOT 2
- Missing WSL Blobs for openSUSE Leap 15.5 HOT 8
- wsl --install not running HOT 4
- network problem mirrored HOT 2
- Error code: Wsl/CallMsi/Install/ERROR_SERVICE_DOES_NOT_EXIST/ I can't install wsl --install HOT 2
- wsl --update failed error code 1603 HOT 9
- Failed to start apt-news.service: Transport endpoint is not connected HOT 14
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from wsl.