WSL2 및 VPN이 연결된 이상한 DNS 확인

WSL2 및 VPN이 연결된 이상한 DNS 확인

Windows 10 내에서 WSL2, Ubuntu 22를 실행하고 있습니다. nslookupVPN에 연결하지 않으면 다음과 같은 결과가 나타납니다(모든 답변은 FQDN google.com에 대한 다른 IP 주소입니다).

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

그러나 VPN에 연결하면 답변이 변경되어 일부 DNS 서버의 IP 주소에 대한 답변도 표시됩니다.

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

나는 예를 보여주고 있지만 google.com조회하려는 모든 URL에서 이런 일이 발생합니다. 그리고 이것이 증상입니다. 실제 문제는 다른 명령(예: curl)이 요청할 때 확인 목록에 있는 무작위(?) IP를 사용하고 때로는 요청이 첫 번째 IP로 이동하여 성공적으로 실행되지만 다른 경우에는 요청이 종료된다는 것입니다. 올바른 IP 대신 DNS 서버로 연결됩니다.

지금은 어디서 문제를 확인해야 할지 모르겠습니다. 문제가 WSL, Windows 네트워킹, VPN의 DNS 서버 구성 오류인지는 알 수 없습니다. 따라서 어떤 종류의 도움이라도 대단히 감사하겠습니다.

추신: Windows의 해상도는 VPN이 연결된 상태에서 직접적으로 잘 작동합니다. 문제는 WSL 내부에만 있습니다.


편집: 디버그 출력 추가. 조회에서 WSL 인터페이스 게이트웨이를 이름 서버로 사용할 때 레코드 AuthorityAdditional병합되는 것처럼 보입니다 .Answers

nslookup -debug google.comWSL2 시스템의 출력입니다 .

이 명령은 WSL 게이트웨이를 네임서버로 사용해야 하며 요청을 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
nslookup -debug google.com 10.0.24.151WSL2 시스템의 출력입니다 .

이 명령은 VPN 네임서버를 직접 사용해야 합니다.

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
nslookup -d google.comWindows에서 의 출력 .

이 명령은 VPN 네임서버를 직접 사용해야 합니다. 내가 일하는 회사와 관련된 이름을 표시하지 않도록 출력이 수정되었습니다.

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

편집 2: WSL용으로 생성된 내부 DNS 서버인 내부 Hyper-V DNS 서버인 Windows 인터넷 연결 공유(ICS) 문제와 관련된 것 같습니다.

많은 사람들이 이 문제에 대해 불평하는 WSL의 GitHub에서 공개 문제를 발견했습니다.

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

관련 정보