Extraña resolución de DNS en WSL2 y VPN conectada

Extraña resolución de DNS en WSL2 y VPN conectada

Estoy ejecutando WSL2, Ubuntu 22, dentro de Windows 10. Cuando nslookupno me conecto a una VPN, obtengo los siguientes resultados (tenga en cuenta que todas las respuestas son direcciones IP diferentes para el FQDN google.com).

daniel@DESKTOP-6M0RKK1:~
⤷ nslookup google.com
Server:         172.23.144.1
Address:        172.23.144.1#53

Non-authoritative answer:
Name:   google.com
Address: 142.251.116.139
Name:   google.com
Address: 142.251.116.102
Name:   google.com
Address: 142.251.116.100
Name:   google.com
Address: 142.251.116.113
Name:   google.com
Address: 142.251.116.101
Name:   google.com
Address: 142.251.116.138

Sin embargo, cuando me conecto a una VPN, las respuestas cambian y muestran también las respuestas de las direcciones IP de algunos servidores DNS.

daniel@DESKTOP-6M0RKK1:~
⤷ nslookup google.com
Server:         172.23.144.1
Address:        172.23.144.1#53

Non-authoritative answer:
Name:   google.com
Address: 142.251.135.110
Name:   ns1.google.com
Address: 216.239.32.10
Name:   ns2.google.com
Address: 216.239.34.10
Name:   ns3.google.com
Address: 216.239.36.10
Name:   ns4.google.com
Address: 216.239.38.10

Estoy mostrando el ejemplo con google.com, pero eso sucede con cualquier URL que intento buscar. Y este es el síntoma, el verdadero problema es que los otros comandos (como curl) utilizan una IP aleatoria (?) de la lista de resolución al realizar la solicitud y, a veces, la solicitud va a la primera IP y se ejecuta correctamente, pero otras veces la solicitud finaliza. se realiza a los servidores DNS en lugar de a la IP correcta.

En este momento no tengo idea de dónde buscar problemas. No sé si el problema es una mala configuración en WSL, en la red de Windows o tal vez en el servidor DNS de VPN. Así que cualquier tipo de ayuda es muy apreciada.

Ps.: La resolución de Windows funciona bien directamente con la VPN conectada. El problema sólo está dentro de WSL.


Editar: Agregar salida de depuración. Parece que Authoritylos Additionalregistros se están fusionando Answerscuando la búsqueda utiliza la puerta de enlace de la interfaz WSL como servidor de nombres.

Salida del nslookup -debug google.comsistema WSL2.

Este comando debe usar la puerta de enlace WSL como servidor de nombres y enviará la solicitud al servidor de nombres VPN.

daniel@DESKTOP-6M0RKK1:~
⤷ nslookup -debug google.com
Server:         172.23.144.1
Address:        172.23.144.1#53

------------
    QUESTIONS:
        google.com, type = A, class = IN
    ANSWERS:
    ->  google.com
        internet address = 142.251.133.174
        ttl = 0
    ->  ns1.google.com
        internet address = 216.239.32.10
        ttl = 0
    ->  ns2.google.com
        internet address = 216.239.34.10
        ttl = 0
    ->  ns3.google.com
        internet address = 216.239.36.10
        ttl = 0
    ->  ns4.google.com
        internet address = 216.239.38.10
        ttl = 0
    AUTHORITY RECORDS:
    ADDITIONAL RECORDS:
------------
Non-authoritative answer:
Name:   google.com
Address: 142.251.133.174
Name:   ns1.google.com
Address: 216.239.32.10
Name:   ns2.google.com
Address: 216.239.34.10
Name:   ns3.google.com
Address: 216.239.36.10
Name:   ns4.google.com
Address: 216.239.38.10
Salida del nslookup -debug google.com 10.0.24.151sistema WSL2.

Este comando debería usar el servidor de nombres VPN directamente.

daniel@DESKTOP-6M0RKK1:~
⤷ nslookup -debug google.com 10.0.24.151
Server:         10.0.24.151
Address:        10.0.24.151#53

------------
    QUESTIONS:
        google.com, type = A, class = IN
    ANSWERS:
    ->  google.com
        internet address = 142.251.133.174
        ttl = 227
    AUTHORITY RECORDS:
    ->  google.com
        nameserver = ns1.google.com.
        ttl = 5636
    ->  google.com
        nameserver = ns2.google.com.
        ttl = 5636
    ->  google.com
        nameserver = ns4.google.com.
        ttl = 5636
    ->  google.com
        nameserver = ns3.google.com.
        ttl = 5636
    ADDITIONAL RECORDS:
    ->  ns1.google.com
        internet address = 216.239.32.10
        ttl = 92272
    ->  ns2.google.com
        internet address = 216.239.34.10
        ttl = 92272
    ->  ns3.google.com
        internet address = 216.239.36.10
        ttl = 18575
    ->  ns4.google.com
        internet address = 216.239.38.10
        ttl = 18575
------------
Non-authoritative answer:
Name:   google.com
Address: 142.251.133.174
Salida de nslookup -d google.comdesde Windows.

Este comando debería usar el servidor de nombres VPN directamente. El resultado se redactó para no mostrar nombres relacionados con la empresa para la que trabajo.

PS C:\Users\danie> nslookup -d google.com
------------
Got answer:
    HEADER:
        opcode = QUERY, id = 1, rcode = NOERROR
        header flags:  response, auth. answer, want recursion, recursion avail.
        questions = 1,  answers = 1,  authority records = 7,  additional = 7

    QUESTIONS:
        151.24.0.10.in-addr.arpa, type = PTR, class = IN
    ANSWERS:
    ->  151.24.0.10.in-addr.arpa
        name = s2-<redacted>
        ttl = 900 (15 mins)
    AUTHORITY RECORDS:
    ->  10.in-addr.arpa
        nameserver = s17-<redacted>
        ttl = 900 (15 mins)
    ->  10.in-addr.arpa
        nameserver = s343-<redacted>
        ttl = 900 (15 mins)
    ->  10.in-addr.arpa
        nameserver = s2-<redacted>
        ttl = 900 (15 mins)
    ->  10.in-addr.arpa
        nameserver = s344-<redacted>
        ttl = 900 (15 mins)
    ->  10.in-addr.arpa
        nameserver = s1-<redacted>
        ttl = 900 (15 mins)
    ->  10.in-addr.arpa
        nameserver = <redacted>
        ttl = 900 (15 mins)
    ->  10.in-addr.arpa
        nameserver = <redacted>
        ttl = 900 (15 mins)
    ADDITIONAL RECORDS:
    ->  s1-<redacted>
        internet address = 10.0.16.253
        ttl = 900 (15 mins)
    ->  <redacted>
        internet address = 10.17.0.4
        ttl = 900 (15 mins)
    ->  s17-<redacted>
        internet address = 10.8.74.34
        ttl = 900 (15 mins)
    ->  <redacted>
        internet address = 10.58.0.240
        ttl = 900 (15 mins)
    ->  s2-<redacted>
        internet address = 10.0.24.151
        ttl = 900 (15 mins)
    ->  s343-<redacted>
        internet address = 10.0.29.143
        ttl = 900 (15 mins)
    ->  s344-<redacted>
        internet address = 10.0.29.144
        ttl = 900 (15 mins)

------------
Server:  s2-<redacted>
Address:  10.0.24.151

------------
Got answer:
    HEADER:
        opcode = QUERY, id = 2, rcode = NXDOMAIN
        header flags:  response, auth. answer, want recursion, recursion avail.
        questions = 1,  answers = 0,  authority records = 1,  additional = 0

    QUESTIONS:
        google.com.<redated_internal_suffix>, type = A, class = IN
    AUTHORITY RECORDS:
    ->  <redated_internal_suffix>
        ttl = 900 (15 mins)
        primary name server = s2-<redacted>.<redated_internal_suffix>
        responsible mail addr = root.s2-<redacted>
        serial  = 2023071101
        refresh = 86400 (1 day)
        retry   = 7200 (2 hours)
        expire  = 2592000 (30 days)
        default TTL = 345600 (4 days)

------------
------------
Got answer:
    HEADER:
        opcode = QUERY, id = 3, rcode = NXDOMAIN
        header flags:  response, auth. answer, want recursion, recursion avail.
        questions = 1,  answers = 0,  authority records = 1,  additional = 0

    QUESTIONS:
        google.com.<redated_internal_suffix>, type = AAAA, class = IN
    AUTHORITY RECORDS:
    ->  <redated_internal_suffix>
        ttl = 900 (15 mins)
        primary name server = s2-<redacted>
        responsible mail addr = root.s2-<redacted>
        serial  = 2023071101
        refresh = 86400 (1 day)
        retry   = 7200 (2 hours)
        expire  = 2592000 (30 days)
        default TTL = 345600 (4 days)

------------
------------
Got answer:
    HEADER:
        opcode = QUERY, id = 4, rcode = NOERROR
        header flags:  response, want recursion, recursion avail.
        questions = 1,  answers = 1,  authority records = 4,  additional = 8

    QUESTIONS:
        google.com, type = A, class = IN
    ANSWERS:
    ->  google.com
        internet address = 142.250.79.14
        ttl = 23 (23 secs)
    AUTHORITY RECORDS:
    ->  google.com
        nameserver = ns2.google.com
        ttl = 6075 (1 hour 41 mins 15 secs)
    ->  google.com
        nameserver = ns4.google.com
        ttl = 6075 (1 hour 41 mins 15 secs)
    ->  google.com
        nameserver = ns3.google.com
        ttl = 6075 (1 hour 41 mins 15 secs)
    ->  google.com
        nameserver = ns1.google.com
        ttl = 6075 (1 hour 41 mins 15 secs)
    ADDITIONAL RECORDS:
    ->  ns1.google.com
        internet address = 216.239.32.10
        ttl = 92711 (1 day 1 hour 45 mins 11 secs)
    ->  ns2.google.com
        internet address = 216.239.34.10
        ttl = 92711 (1 day 1 hour 45 mins 11 secs)
    ->  ns3.google.com
        internet address = 216.239.36.10
        ttl = 19014 (5 hours 16 mins 54 secs)
    ->  ns4.google.com
        internet address = 216.239.38.10
        ttl = 19014 (5 hours 16 mins 54 secs)
    ->  ns1.google.com
        AAAA IPv6 address = 2001:4860:4802:32::a
        ttl = 160225 (1 day 20 hours 30 mins 25 secs)
    ->  ns2.google.com
        AAAA IPv6 address = 2001:4860:4802:34::a
        ttl = 160225 (1 day 20 hours 30 mins 25 secs)
    ->  ns3.google.com
        AAAA IPv6 address = 2001:4860:4802:36::a
        ttl = 160225 (1 day 20 hours 30 mins 25 secs)
    ->  ns4.google.com
        AAAA IPv6 address = 2001:4860:4802:38::a
        ttl = 160225 (1 day 20 hours 30 mins 25 secs)

------------
Non-authoritative answer:
------------
Got answer:
    HEADER:
        opcode = QUERY, id = 5, rcode = NOERROR
        header flags:  response, want recursion, recursion avail.
        questions = 1,  answers = 1,  authority records = 4,  additional = 8

    QUESTIONS:
        google.com, type = AAAA, class = IN
    ANSWERS:
    ->  google.com
        AAAA IPv6 address = 2800:3f0:4004:808::200e
        ttl = 41 (41 secs)
    AUTHORITY RECORDS:
    ->  google.com
        nameserver = ns1.google.com
        ttl = 6075 (1 hour 41 mins 15 secs)
    ->  google.com
        nameserver = ns3.google.com
        ttl = 6075 (1 hour 41 mins 15 secs)
    ->  google.com
        nameserver = ns4.google.com
        ttl = 6075 (1 hour 41 mins 15 secs)
    ->  google.com
        nameserver = ns2.google.com
        ttl = 6075 (1 hour 41 mins 15 secs)
    ADDITIONAL RECORDS:
    ->  ns1.google.com
        internet address = 216.239.32.10
        ttl = 92711 (1 day 1 hour 45 mins 11 secs)
    ->  ns2.google.com
        internet address = 216.239.34.10
        ttl = 92711 (1 day 1 hour 45 mins 11 secs)
    ->  ns3.google.com
        internet address = 216.239.36.10
        ttl = 19014 (5 hours 16 mins 54 secs)
    ->  ns4.google.com
        internet address = 216.239.38.10
        ttl = 19014 (5 hours 16 mins 54 secs)
    ->  ns1.google.com
        AAAA IPv6 address = 2001:4860:4802:32::a
        ttl = 160225 (1 day 20 hours 30 mins 25 secs)
    ->  ns2.google.com
        AAAA IPv6 address = 2001:4860:4802:34::a
        ttl = 160225 (1 day 20 hours 30 mins 25 secs)
    ->  ns3.google.com
        AAAA IPv6 address = 2001:4860:4802:36::a
        ttl = 160225 (1 day 20 hours 30 mins 25 secs)
    ->  ns4.google.com
        AAAA IPv6 address = 2001:4860:4802:38::a
        ttl = 160225 (1 day 20 hours 30 mins 25 secs)

------------
Name:    google.com
Addresses:  2800:3f0:4004:808::200e
          142.250.79.14

Edición 2: Parece que está relacionado con un problema con el servidor DNS interno creado para WSL, que es el servidor DNS interno de Hyper-V, que es la Conexión compartida a Internet (ICS) de Windows.

Encontré un problema abierto en GitHub de WSL y mucha gente se quejó del problema.

https://github.com/microsoft/WSL/issues/5806

información relacionada