Closed mnixry closed 2 years ago
@mnixry Hi there! This is a method to prevent abuse. Now we redirect non-China IP to GitHub.
This is a method to prevent abuse. Now we redirect non-China IP to GitHub.
Thank you for your early reply, but I could ensure I'm using China IP address 223.108.0.0/14
.
Does it means I need to modify my DNS options?
@mnixry Ummm.. It's weird. We use Aliyun's intelligent DNS resolution to return ip depends geographical locations. I guess that you may use Shadowsocks or similar application so that caused a cached DNS result?(I'm not sure)
And, I think your solution is right. You can correct DNS result by modifying hosts.
@mnixry If you want to get our current DNS records list, mail me. My Email is realkevin@tutanota.com.
Okay, after trying, I found that whether the DNS server is in the mainland determines the resolution result:
8.8.8.8
Google DNS, it returned Cloudflare IP:
1.1.1.1
Cloudflare DNS either; <<>> DiG 9.16.6 <<>> @8.8.8.8 hub.fastgit.org
; (1 server found)
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 9379
;; flags: qr rd ra; QUERY: 1, ANSWER: 4, AUTHORITY: 0, ADDITIONAL: 1
;; OPT PSEUDOSECTION:
; EDNS: version: 0, flags:; udp: 512
;; QUESTION SECTION:
;hub.fastgit.org. IN A
;; ANSWER SECTION:
hub.fastgit.org. 262 IN CNAME hub.fastgit.org.cdn.cloudflare.net.
hub.fastgit.org.cdn.cloudflare.net. 299 IN A 104.18.41.99
hub.fastgit.org.cdn.cloudflare.net. 299 IN A 104.18.40.99
hub.fastgit.org.cdn.cloudflare.net. 299 IN A 172.67.201.159
;; Query time: 100 msec
;; SERVER: 8.8.8.8#53(8.8.8.8)
;; WHEN: Wed Sep 02 08:54:24 CST 2020
;; MSG SIZE rcvd: 140
114.114.114.114
DNS, it returned normal IP:; <<>> DiG 9.16.6 <<>> @114.114.114.114 hub.fastgit.org
; (1 server found)
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 41842
;; flags: qr rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 0, ADDITIONAL: 1
;; OPT PSEUDOSECTION:
; EDNS: version: 0, flags:; udp: 512
;; QUESTION SECTION:
;hub.fastgit.org. IN A
;; ANSWER SECTION:
hub.fastgit.org. 36 IN A (**Server IP**)
;; Query time: 80 msec
;; SERVER: 114.114.114.114#53(114.114.114.114)
;; WHEN: Wed Sep 02 08:54:40 CST 2020
;; MSG SIZE rcvd: 60
A large number of users in mainland China may use foreign DNS servers, especially developers who need to use GitHub services. So in my opinion, it is not a good idea to use DNS to determine whether visitors are from China.
Ummm, maybe.
Also, do you have some good idea? Just to solve it.
Should we use GeoIP as? umm, limit? idk
Should we use GeoIP as? umm, limit? idk
Some server providers may provide hardware-based firewalls that can provide network segment-based blocking services (similar to the "security group" provided by Alibaba Cloud), but this will completely denied access from non-China IP instead of redirect user to GitHub. But deploying IP-based redirection rule in the Nginx application layer will also consume server CPU and bandwidth resources :facepalm: .
I can't think of a better way other than the hardware firewall provided by the service provider :( BTW, when the server is under DDoS attack, most of the traffic will usually come from non-China IP. Maybe this is also a means to block DDoS attacks?
@mnixry To deny non-China access is just to save money you know....
Now we move download to CDN. Waiting for SSL request.
Today when I access fastgit, it returned 301 redirection
if I use HTTPS connection, it returned 301 also: