2

I have a weird connection problem. It occured a week ago. I am on Ubuntu 20.04. I can connect to router over wireless, but I can not browse web pages. Strange thing is that Windows, IOS, mobiles connect and browse. In order for me to browse the net, my brother has to upload some files to google drive within his Iphone, then connection problem disappears. It's the only solution for the time being. I didn't call ISP because I am the only one who has that issue. I can ping the domain addresses but traceroot fails to retrieve the route.

It appears to be a DNS issue, I tried different DNS servers both within the router and my laptop with no luck. What I don't understand is that why only my Linux machine is affected. I know there are many questions with the same title. I read most of them.

EDIT:

ls -al /etc/resolv.conf
lrwxrwxrwx 1 root root 29 Aug 31 23:15 /etc/resolv.conf -> ../run/resolvconf/resolv.conf

cat /etc/resolv.conf

Dynamic resolv.conf(5) file for glibc resolver(3) generated by resolvconf(8)

DO NOT EDIT THIS FILE BY HAND -- YOUR CHANGES WILL BE OVERWRITTEN

127.0.0.53 is the systemd-resolved stub resolver.

run "systemd-resolve --status" to see details about the actual nameservers.

nameserver 127.0.0.53 nameserver 8.8.8.8 nameserver 8.8.4.4

I also tried to connect from live iso nothing changed.

EDIT2:

From within router I ran a test. I get Ping default gateway fail error. When my brother starts uploading again it passes all tests.

Router's TP LINK TD-W9970. enter image description here

EDIT3:

Uploading a file to google drive from within my computer also keeps the connection online till the upload ends. Then I get locked out again.

kenn
  • 5,162
  • 1
    "appears to be a DNS issue" based on what? can you browse (or wget) using the remote host's IP address? can you ping both by name and IP? I wonder if it is more likely a DHCP issue or an address conflict between DHCP-assigned and statically assigned LAN IPs on your network? – steeldriver Sep 06 '20 at 13:28
  • Please edit your question to add the result of these terminal commands: cat /etc/resolv.conf and also: ls -al /etc/resilv.conf – chili555 Sep 06 '20 at 13:49
  • @steeldriver never mind my assumptions, I need your help. Using ip address in the browser didn't work. – kenn Sep 06 '20 at 15:13
  • @steeldriver I can ping both by name and ip. I wonder if it is more likely a DHCP issue or an address conflict between DHCP-assigned and statically assigned LAN IPs on your network How can I debug it? – kenn Sep 06 '20 at 15:17
  • Well at the most basic level, you could go around and note down the IP addresses of all the devices... if you can access your router's web interface it may provide a list of connected devices with all their assigned IP addresses... you could also try an nmap scan. Of course it might not be an address conflict, that's just the first thing that came to mind when you mention that your brother's iphone affects your laptop's connectivity. – steeldriver Sep 06 '20 at 15:35
  • Probable solution and duplicate: https://askubuntu.com/questions/1150239/run-resolvconf-resolv-conf-ubuntu-18-04/1150294#1150294 – chili555 Sep 06 '20 at 16:52
  • @chili555 I just tried your suggestion, unfortunately it doesn't work. – kenn Sep 06 '20 at 17:54
  • "In order for me to browse the net, my brother has to upload some files to google drive within his Iphone, then connection problem disappears." What is the fix? What files? Please elaborate. – chili555 Sep 06 '20 at 17:58
  • His iphone connected to the same router as my laptop. If he starts to upload any file to google drive then I can access to internet. Uploading any file to his google drive account from hisWindows laptop or ipad also works. – kenn Sep 06 '20 at 18:45

3 Answers3

4

In your case, /etc/resolv.conf is not pointing to systemd as expected. Therefore, please remove and recreated the link:

sudo rm -f /etc/resolv.conf
sudo ln -s /run/systemd/resolve/resolv.conf /etc/resolv.conf

Reboot and let us see:

ping -c3 8.8.8.8
ping -c3 www.ubuntu.com
chili555
  • 60,188
  • Thank you for responding. I read the answer given by Gerald [https://askubuntu.com/questions/1209859/ubuntu-18-04-dns-resolution-fails-after-a-while] and applied it yesterday and it didn't work. – kenn Sep 08 '20 at 21:10
  • The expected link to use systemd-resolv is to use the /run/systemd/resolve/stub-resolv.conf – ubfan1 Sep 08 '20 at 21:34
  • Your edit doesn't reflect the change. May we see: sudo service systemd-resolved status – chili555 Sep 09 '20 at 00:52
  • 1
    this solved my problem where I could ping and the terminal could install packages using repository domains with no issues, but I couldn't browse. it even didn't need a reboot. thanks. – Anan Raddad Aug 19 '22 at 05:45
0

I found the fix after a week of struggling.

I noticed via

    netstat -pnt

that I have many SYN_SENT signals but no SYN/ACK

entering correct key words into search engines and checking out right Q/As directed me to @mcdizzle's answer

Appending the line net.ipv4.tcp_timestamps=0 into /etc/sysctl.conf

    sysctl -w net.ipv4.tcp_timestamps=0
    sysctl -p

made me on line. Thank you mcdizzle

kenn
  • 5,162
0

I have fixed my DNS issues by adding 8.8.8.8 and 8.8.4.4 to the list of DNS servers. My /etc/resolv.conf reads like:

# 127.0.0.53 is the systemd-resolved stub resolver.

nameserver 127.0.0.53 nameserver 8.8.8.8 nameserver 8.8.4.4 options edns0 trust-ad search DOMAINS

I don't know if this is a canonical solution, but it works for me.

Francesc
  • 101