2

I am using Ubuntu 22.04. I recently moved to a new place with a different wifi. When I connect to the wifi on other devices running Windowns/android/iPodOS everything works well. But on my ubuntu I am unable to access many (most) sites. I can access google affiliated sites and use google search, as well as some other websites. But e.g. stackexchange websites are unreachable on firefox. I simply get a 'Server not found' error. The same happens when I try to ping these sites with ping www.twitter.com.

While connected to the home netowork, I ran ip route list and got no output. On the other hand when I run ip -6 route list I get some output including a default route. When I use my phone's hotspot instead, everything works well and I also get an output including a default route with ip route list. So I'm guessing this is somehow the problem.

I have tried the solution from here and here but nothing changed.

Enforce
  • 71
  • looks as if you only got an IPv6 address but no IPv4 address. Usually this should work fine, can you try to ping a "well known" IPv4 address like 8.8.8.8? Maybe just name resolution has to be fixed... – cyberbrain May 16 '23 at 21:07
  • I don't think so. I'm not sure I understand what is going on in that question. – Enforce May 16 '23 at 22:48
  • when I try to ping that address I get ping: connect: Network is unreachable. However, I can ping www.google.com just fine. – Enforce May 16 '23 at 23:00
  • Well, let's try to reduce the problem for now. Try running ping 1.1.1.1. If it doesn't work, then you're unable to connect to IPv4 IP addresses altogether. If it does work, then you can use IPv4, so the problem would be most likely in DNS resolution. In case it's the latter, try editing /etc/resolv.conf and replacing all its contents with just nameserver 1.1.1.1 (This is CloudFlare's public DNS), then ping some domain like wikipedia.org and see if that works. – Spaceship Operations May 19 '23 at 19:50
  • pinging 1.1.1.1 does not work... are there any workarounds? – Enforce May 21 '23 at 17:06
  • 1
    https://askubuntu.com/questions/1025008/ipv6-is-working-but-ipv4-isnt – Esther May 22 '23 at 18:43
  • can you post output of "ip a" and content of network config file in /etc/netplan/. Replace last numbers of ip address with xx. – Thomas Aichinger May 25 '23 at 11:26
  • Have you tried connecting your computer to the router directly with a cable? Does that allow access to all sites? What router are you using? Could an old DHCP lease be in effect from the previous network that is somehow confusing the connection and/or providing incorrect DNS servers? – mpboden May 26 '23 at 00:28
  • Please update your question with the output of each of the following commands: ip a, ip route, resolvectl, cat /etc/netplan/*, systemctl status systemd-resolved, ls -l /etc/resolv.conf – mpboden May 26 '23 at 00:33
  • I will update the question once I have access to that computer again. Currently I am away from home. – Enforce May 26 '23 at 13:35

2 Answers2

0

Click activities and search for "network". Select the "Advanced network" icon. Select your connection and go to the "IPV4" tab:

1

The method Automatic(DHCP) should be selected by default. If not change it. This is the place where you could add additional DNS servers (like 8.8.8.8) into the corresponding entry fields.

kanehekili
  • 6,402
  • I have tried this as it was posted as a solution to similar problems. It didn't affect anything. – Enforce May 29 '23 at 21:47
-1

Change the IPv4 DNS to Google Public DNS, Search Google Public DNS in google. check

https://developers.google.com/speed/public-dns/docs/using#linux

  • 3
    OP says they can't even ping 8.8.8.8, this will not solve the problem if the computer can't connect to any ipv4 addresses. – Esther May 23 '23 at 13:57
  • 1
    please check network setting, you might have disabled ipv4. Go to wifi settings, Click on the settings icon of your wifi network, Go to IPV4 tab and change IPV4 method from disable to automatic – Biswajit Bimoli May 24 '23 at 07:52
  • This does not solve the problem. IPV4 seems not to be activated. (which is strange - I always had to disable IPV6, but never enable ipv4) – kanehekili May 24 '23 at 22:12