I am having ubuntu 18.04 on a HP Omen laptop.
I have noticed that whenever I visit a website that I haven't visited before or I havent visited for the last hours it takes too many seconds to load(2-5sec). After the first time if i visit later it takes 'normal' time(0.1-0.5sec).
What I have tried/to be mentioned:
- I have tested it on both Chrome and Firefox with the same issue on both.
- wireless and wired test: same issue occurs.
- I have disabled hardware accelerator from chrome and didn't helped.
- another computer running on the same network with windows OS doesn't have this issue.
And some tests(taking advice from heynnema):
time host www.booking.com
When running the above for first time run (2.4sec)
real 0m2,410s
user 0m0,010s
sys 0m0,000s
Running it again (0.01sec):
real 0m0,011s
user 0m0,000s
sys 0m0,010s
Tested also on other websites where I saw some reaching even 6seconcs when running for first time.
Edit1
Also:
ls -al /etc/resolv.conf
lrwxrwxrwx 1 root root 39 Σεπ 3 21:00 /etc/resolv.conf -> ../run/systemd/resolve/stub-resolv.conf
and:
cat /etc/resolv.conf
# This file is managed by man:systemd-resolved(8). Do not edit.
#
# This is a dynamic resolv.conf file for connecting local clients to
the
# internal DNS stub resolver of systemd-resolved. This file lists all
# configured search domains.
#
# Run "systemd-resolve --status" to see details about the uplink DNS
servers
# currently in use.
#
# Third party programs must not access this file directly, but only
through the
# symlink at /etc/resolv.conf. To manage man:resolv.conf(5) in a
different way,
# replace this symlink by a static file or a different symlink.
#
# See man:systemd-resolved.service(8) for details about the supported
modes of
# operation for /etc/resolv.conf.
nameserver 127.0.0.53
options edns0
and:
ip addr | grep mtu
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1000
2: eno1: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc fq_codel state UP group default qlen 1000
3: wlo1: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc mq state UP group default qlen 1000
4: docker0: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc noqueue state DOWN group default
5: br-44cc05437844: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc noqueue state DOWN group default
6: br-a928e5f9d267: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc noqueue state DOWN group default
and /etc/systemd/resolved.conf
:
# /etc/nsswitch.conf
#
# Example configuration of GNU Name Service Switch functionality.
# If you have the `glibc-doc-reference' and `info' packages installed,
try:
# `info libc "Name Service Switch"' for information about this file.
passwd: compat systemd
group: compat systemd
shadow: compat
gshadow: files
hosts: files mdns4_minimal [NOTFOUND=return] dns myhostname
networks: files
protocols: db files
services: db files
ethers: db files
rpc: db files
netgroup: nis
and /etc/systemd/resolved.conf
:
# This file is part of systemd.
#
# systemd is free software; you can redistribute it and/or modify it
# under the terms of the GNU Lesser General Public License as published by
# the Free Software Foundation; either version 2.1 of the License, or
# (at your option) any later version.
#
# Entries in this file show the compile time defaults.
# You can change settings by editing this file.
# Defaults can be restored by simply deleting this file.
#
# See resolved.conf(5) for details
[Resolve]
#DNS=
#FallbackDNS=
#Domains=
#LLMNR=no
#MulticastDNS=no
#DNSSEC=no
#Cache=yes
#DNSStubListener=yes
Edit2
Also using the answer from Use curl to find out which part of the process of loading a website is giving you trouble (used www.booking.com for the example below) I have the following result:
DNS lookup : 6,516376
Connect to server (TCP) : 6,718620
Connect to server (HTTP/S) : 0,000000
Time from start until transfer began: 6,718712
Time for redirection (if any) : 0,000000
Total time before transfer started : 6,950434
Total time : 6,950476
Size of download (bytes) : 0
Average d/l speed (bytes/s) : 0,000
Seems like DNS lookup is taking the longest.
Any idea why is this happening? Thanks
Edit3
I have created a new resolv conf file resolv8.conf
in /run/systemd/resolve
with the following inside(google dns):
nameserver 8.8.8.8
nameserver 8.8.4.4
and a new symlink:
sudo ln -s /run/systemd/resolve/resolv8.conf /etc/resolv.conf
and now host -v ..
and dns lookup timings are reasonable. However, there is 'collateral damage'. In every restart I loose the resolv8.conf
file so I have to rewrite it and create new symlink again. Also with these changes chrome browsing works normally but not Firefox where I cant access any website(?? maybe i need to do something with networkManager?).
I tottaly dont get why is quicker now though.
Also is there a good way to make the changes permanent? Will this affect when I am connected to other rooters except of my house?
Edit4
Here a screenshot of my rooter configurations in case there are some wrong defined configs
Edit5
Testing on fresh 'try ubuntu 18.04' from usb:
Configurations seems the same with the above and also:
ip addr | grep mtu
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1000
2: eno1: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc fq_codel state DOWN group default qlen 1000
3: wlo1: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc mq state UP group default qlen 1000
and
host -v www.airbnb.com | grep -i received
Received 190 bytes from 127.0.0.53#53 in 54 ms
Received 39 bytes from 127.0.0.53#53 in 432 ms
Received 39 bytes from 127.0.0.53#53 in 1847 ms
host -v www.booking.com | grep -i received
Received 69 bytes from 127.0.0.53#53 in 34 ms
Received 35 bytes from 127.0.0.53#53 in 823 ms
Received 35 bytes from 127.0.0.53#53 in 1039 ms
Seems that there is the same issue. Slow dns lookup
terminal
dohost www.ebay.com
twice in a row, and measure the time it takes each time... the first one will take longer... but by how much? Edit your question and show mels -al /etc/resolv.conf
andcat /etc/resolv.conf
. Also... are you on DSL? – heynnema Nov 30 '19 at 17:07