0

I am using a Dell Inspiron 15R laptop and have Windows 10 and Ubuntu 17.04 on Dual boot.

I am unable to connect to few websites from Ubuntu (either using Chrome or Firefox) when connected to my current router which is D-Link DIR-605L N300. I am able to connect to the websites using Windows on same laptop or using my Android.

Also, the issues to connect to these websites are intermittent. Sometimes I am able to connect to the websites which had a DNS error a while ago in Ubuntu.

Nikit Batale
  • 101
  • 1
  • Try changing your primary DNS server to `8.8.8.8` and secondary to `8.8.4.4` – You'reAGitForNotUsingGit Sep 29 '17 at 11:38
  • Please, show the content of file `/etc/resolv.conf` on your Ubuntu machine. – M. Dm. Sep 29 '17 at 13:47
  • Are you using DSL? What is your MTU set to? – heynnema Sep 29 '17 at 15:45
  • @M.Dm. $ 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 – Nikit Batale Sep 30 '17 at 15:09
  • @heynnema I am using PPPoE to connect and the MTU is set to 1492. – Nikit Batale Sep 30 '17 at 15:22
  • @AndroidDev I have edited the connection Method from "Automatic(DHCP)" to "Automatic(DHCP) addresses only". And set the DNS servers to "8.8.8.8, 8.8.4.4" – Nikit Batale Sep 30 '17 at 15:22

1 Answers1

0

Your problem is with the MTU setting for your DSL/PPPoE connection.

There's a MTU setting in Ubuntu's network configuration, and a WAN MTU setting in your router.

For DSL, a common MTU setting is 1492. Just go ahead and try this value first and see if your web sites are now accessible.

To determine the correct setting, start with all MTU settings = 1500 and VPN = off. (VPN requires different testing).

In terminal:

ping [-c count] [-M do] [-s packet_size] [host]

The options used are:

  • c count: number of times to ping
  • M hint: Select Path MTU Discovery strategy. may be either do (prohibit fragmentation, even local one), want (do PMTU discovery, fragment locally when packet size is large), or dont (do not set DF flag).
  • s packet_size: Specifies the number of data bytes to be sent.

You should always start at 1472 and work your way down by 10 each time. Once you get a reply, go up by 1 until you get a fragmented packet. Take that value (last good value) and add 28 to the value to account for the various TCP/IP headers. Eg. let's say that 1452 was the proper packet size (where you first got an ICMP reply to your ping). The actual MTU size would be 1480, which is the optimum for the network we're working with.

ping -c 4 -M do -s 1472 8.8.8.8 # this will probably show fragmentation

ping -c 4 -M do -s 1462 8.8.8.8 # may show fragmentation

ping -c 4 -M do -s 1452 8.8.8.8 # no fragmentation?

ping -c 4 -M do -s 1453 8.8.8.8 # still no fragmentation?

reference: How to determine the proper MTU size with ICMP pings

heynnema
  • 68,647
  • 15
  • 124
  • 180