refraction-networking / conjure

Conjure Refraction Networking station code
https://refraction.network
Apache License 2.0
66 stars 19 forks source link

About Default STUN server #232

Open Lanius-collaris opened 9 months ago

Lanius-collaris commented 9 months ago

If I send a Chinese IPv4 subnet, I can't get AAAA records of stun.l.google.com dig @9.9.9.12 -p 9953 +subnet=202.97.81.0/24 stun.l.google.com AAAA

; <<>> DiG 9.18.17 <<>> @9.9.9.12 -p 9953 +subnet stun.l.google.com AAAA
; (1 server found)
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 14566
;; flags: qr rd ra; QUERY: 1, ANSWER: 0, AUTHORITY: 1, ADDITIONAL: 1

;; OPT PSEUDOSECTION:
; EDNS: version: 0, flags:; udp: 1232
; COOKIE: dbc39c63fcfa47c501000000650d48ff2a5e545c303a8b0b (good)
; CLIENT-SUBNET: 202.97.81.0/24/20
;; QUESTION SECTION:
;stun.l.google.com.     IN  AAAA

;; AUTHORITY SECTION:
l.google.com.       60  IN  SOA ns1.google.com. dns-admin.google.com. 566064966 900 900 1800 60

;; Query time: 111 msec
;; SERVER: 9.9.9.12#9953(9.9.9.12) (UDP)
;; WHEN: Fri Sep 22 15:57:51 CST 2023
;; MSG SIZE  rcvd: 145

dig @9.9.9.12 -p 9953 +subnet=240e:f9:8010::/64 stun.l.google.com AAAA

; <<>> DiG 9.18.17 <<>> @9.9.9.12 -p 9953 +subnet stun.l.google.com AAAA
; (1 server found)
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 20812
;; flags: qr rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 0, ADDITIONAL: 1

;; OPT PSEUDOSECTION:
; EDNS: version: 0, flags:; udp: 1232
; COOKIE: d233cd522d7f549001000000650d49533c6b2aea802c24be (good)
; CLIENT-SUBNET: 240e:f9:8010::/64/34
;; QUESTION SECTION:
;stun.l.google.com.     IN  AAAA

;; ANSWER SECTION:
stun.l.google.com.  300 IN  AAAA    2404:6800:400a:1001::7f

;; Query time: 88 msec
;; SERVER: 9.9.9.12#9953(9.9.9.12) (UDP)
;; WHEN: Fri Sep 22 15:59:15 CST 2023
;; MSG SIZE  rcvd: 118

stunserver.stunprotocol.org:3479 and stun.nextcloud.com:443 support IPv6 as well.

mingyech commented 9 months ago

We'll change the default server to something else. The plan is to make a list of STUN servers to choose randomly like snowflake to avoid depending on one server.