Git Product home page Git Product logo

Comments (7)

CatalinFetoiu avatar CatalinFetoiu commented on August 22, 2024 2

@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.

CatalinFetoiu avatar CatalinFetoiu commented on August 22, 2024 1

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.

github-actions avatar github-actions commented on August 22, 2024

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.

from wsl.

lucastheisen avatar lucastheisen commented on August 22, 2024

/emailed-logs

from wsl.

github-actions avatar github-actions commented on August 22, 2024
Diagnostic information
Found '/emailed-logs', adding tag 'emailed-logs'

from wsl.

lucastheisen avatar lucastheisen commented on August 22, 2024

@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.

lucastheisen avatar lucastheisen commented on August 22, 2024

@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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.