I cannot access to GitHub only on my Ubuntu 18.04 machine and all other machines (Windows PC, iPad, Phone) connected to the same network can access GitHub.

When I try to ping GitHub, I get

result of ping github.com

The result of run nslookup github.com:


Non-authoritative answer:
Name:   github.com

If I try sudo route -n:

Kernel IP routing table
Destination     Gateway         Genmask         Flags Metric Ref    Use Iface         UG    600    0        0 wlp4s0     U     1000   0        0 wlp4s0   U     600    0        0 wlp4s0

If I ping google.com, it works.

I can't access GitHub in the browser also. However, all other websites work fine. Also, I can access GitHub on other devices. Is there anything wrong with the DNS?

  • There is something wrong with the IP address. When I lookup github.com the IP is It looks like that you may have a DNS problem.
    – NK_
    Jun 28 '20 at 14:13
  • @NK_ When I typed in the IP you gave ( in the browser, I noticed the address was redirected to github.com. And same to the IP address I provided (, the address was also redirected to github.com. The only problem is that the site "can't be reached", so I would say the IP address is correct. It's different just because that different DNS resolve the address of github.com differently according to the location.
    – joeller
    Jun 28 '20 at 19:39
  • Looks like you are correct joeller. Do you mean you cannot access both and on your browser? Just a little possibility, but maybe enabling location services might help.
    – NK_
    Jun 29 '20 at 10:18

I got exactly same problem below is how I solve it : In short : there might be a github.com mistakenly configured in

Please comment out item below , everything works right for me  
# Github
# github.com


  • Wow! Thanks so much @Jia. That solved my problem!!!
    – joeller
    Jul 23 '20 at 13:17
  • Fixed for me as well, +1
    – cognalog
    Feb 6 at 20:15

Doing a reverse DNS lookup on the IP address posted in the question, reveals that this points to a DNS server with hostname dns1.p07.nsone.net rather than github.com.

$ dig -x

; <<>> DiG 9.11.3-1-Debian <<>> -x
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NXDOMAIN, id: 48141
;; flags: qr rd ra; QUERY: 1, ANSWER: 0, AUTHORITY: 1, ADDITIONAL: 1

; EDNS: version: 0, flags:; udp: 4096
;   IN      PTR

253.30.192.in-addr.arpa. 3600   IN      SOA     dns1.p07.nsone.net. hostmaster.nsone.net. 1591647771 43200 7200 1209600 3600

;; Query time: 41 msec
;; WHEN: Sat Jul 18 16:59:59 CST 2020
;; MSG SIZE  rcvd: 121

In other words, this is a DNS problem. How to resolve the issue ?

  • attempt changing your nameserver (there are plenty of public nameservers to choose from, such as Google DNS, OpenDNS, Level 3, and others). There are several ways depending on your Ubuntu release. For the most recent ones, that can be done via netplan settings

  • If is your ISP's nameserver, report the issue to their technical support so that the issue can be fixed on their end


Your dns server is pointed to a loopback, therefore your own machine. You can change the dns servers by doing the following:

nano /etc/netplan/01-netcfg.yaml

Under nameservers then addresses enter this:

      addresses: [,]

Run this to apply the changes:

sudo netplan apply

Then to verify the changes have been made run this:

systemd-resolve --status | grep 'DNS Servers' -A2
  • Thanks Jack! I tried to modified the DNS server as you replied. But I still can't ping and access GitHub. If the DNS server is pointed to a loopback as you said, then all sites can't be reached by the URL. But in my case the only thing wrong is GitHub.
    – joeller
    Jun 28 '20 at 19:46
  • Have you tried clearing your dns cache? Jun 28 '20 at 19:47
  • Yes, I tried that.
    – joeller
    Jun 29 '20 at 6:43

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.