Slow connection

I had some issue with my VPN, it was not giving me the results I expected, so the VPN support had me do this:

"sudo rm -r /etc/resolv.conf
sudo nano /etc/resolv.conf

You will be asked for your root password after each command line, so just type it in and press enter. When the text editor opens, you will have to type in these lines:

nameserver 162.252.172.57
nameserver 149.154.159.92

Now you have to close and save the file, you can do that by clicking Ctrl + X and pressing Y.

After that, please type in the last command in the terminal:
chattr +i /etc/resolv.conf

Once you are finished, just reboot your device to successfully apply these changes!

I would like to note that if chattr +i does not work, try using the following command instead:
sudo chattr -f +i /etc/resolv.conf "

After this every time I open a new internet page it takes for ever to load.
I tried to run this again sudo rm -r /etc/resolv.conf to remove the changes and hopefully have the system recreate the file, but I got a permission denied.

inxi -Fazy

System:
  Kernel: 5.15.94-1-MANJARO arch: x86_64 bits: 64 compiler: gcc v: 12.2.1
    parameters: BOOT_IMAGE=/boot/vmlinuz-5.15-x86_64
    root=UUID=777c477a-f86e-459e-b526-da0095b9349c rw quiet apparmor=1
    security=apparmor udev.log_priority=3
  Desktop: Xfce v: 4.18.1 tk: Gtk v: 3.24.36 info: xfce4-panel wm: xfwm
    v: 4.18.0 vt: 7 dm: LightDM v: 1.32.0 Distro: Manjaro Linux base: Arch Linux
Machine:
  Type: Desktop Mobo: ASRock model: Z370 Pro4 serial: <superuser required>
    UEFI-[Legacy]: American Megatrends v: P4.30 date: 10/31/2019
Battery:
  Device-1: hidpp_battery_0 model: Logitech Wireless Keyboard serial: <filter>
    charge: 55% (should be ignored) rechargeable: yes status: discharging
  Device-2: hidpp_battery_1 model: Logitech Marathon Mouse/Performance Plus
    M705 serial: <filter> charge: 100% (should be ignored) rechargeable: yes
    status: discharging
CPU:
  Info: model: Intel Core i5-8400 bits: 64 type: MCP arch: Coffee Lake
    gen: core 8 level: v3 note: check built: 2018 process: Intel 14nm family: 6
    model-id: 0x9E (158) stepping: 0xA (10) microcode: 0xF0
  Topology: cpus: 1x cores: 6 smt: <unsupported> cache: L1: 384 KiB
    desc: d-6x32 KiB; i-6x32 KiB L2: 1.5 MiB desc: 6x256 KiB L3: 9 MiB
    desc: 1x9 MiB
  Speed (MHz): avg: 800 min/max: 800/4000 scaling: driver: intel_pstate
    governor: powersave cores: 1: 800 2: 800 3: 800 4: 800 5: 800 6: 800
    bogomips: 33613
  Flags: avx avx2 ht lm nx pae sse sse2 sse3 sse4_1 sse4_2 ssse3 vmx
  Vulnerabilities:
  Type: itlb_multihit status: KVM: VMX disabled
  Type: l1tf mitigation: PTE Inversion; VMX: conditional cache flushes, SMT
    disabled
  Type: mds mitigation: Clear CPU buffers; SMT disabled
  Type: meltdown mitigation: PTI
  Type: mmio_stale_data mitigation: Clear CPU buffers; SMT disabled
  Type: retbleed mitigation: IBRS
  Type: spec_store_bypass mitigation: Speculative Store Bypass disabled via
    prctl and seccomp
  Type: spectre_v1 mitigation: usercopy/swapgs barriers and __user pointer
    sanitization
  Type: spectre_v2 mitigation: IBRS, IBPB: conditional, RSB filling,
    PBRSB-eIBRS: Not affected
  Type: srbds mitigation: Microcode
  Type: tsx_async_abort status: Not affected
Graphics:
  Device-1: AMD Lexa PRO [Radeon 540/540X/550/550X / RX 540X/550/550X]
    vendor: XFX Pine driver: amdgpu v: kernel arch: GCN-4 code: Arctic Islands
    process: GF 14nm built: 2016-20 pcie: gen: 3 speed: 8 GT/s lanes: 4
    link-max: lanes: 8 ports: active: DP-1,HDMI-A-1 empty: DVI-D-1
    bus-ID: 03:00.0 chip-ID: 1002:699f class-ID: 0300 temp: 39.0 C
  Display: x11 server: X.Org v: 21.1.7 compositor: xfwm v: 4.18.0 driver: X:
    loaded: amdgpu unloaded: modesetting alternate: fbdev,vesa dri: radeonsi
    gpu: amdgpu display-ID: :0.0 screens: 1
  Screen-1: 0 s-res: 3840x1080 s-dpi: 96 s-size: 1016x285mm (40.00x11.22")
    s-diag: 1055mm (41.54")
  Monitor-1: DP-1 mapped: DisplayPort-0 pos: primary,left model: Dell S2340L
    serial: <filter> built: 2014 res: 1920x1080 hz: 60 dpi: 96 gamma: 1.2
    size: 509x286mm (20.04x11.26") diag: 584mm (23") ratio: 16:9 modes:
    max: 1920x1080 min: 720x400
  Monitor-2: HDMI-A-1 mapped: HDMI-A-0 pos: right model: Dell S2340L
    serial: <filter> built: 2014 res: 1920x1080 hz: 60 dpi: 96 gamma: 1.2
    size: 509x286mm (20.04x11.26") diag: 584mm (23") ratio: 16:9 modes:
    max: 1920x1080 min: 720x400
  API: OpenGL Message: Unable to show GL data. Required tool glxinfo missing.
Audio:
  Device-1: Intel 200 Series PCH HD Audio vendor: ASRock driver: snd_hda_intel
    v: kernel bus-ID: 1-10:6 chip-ID: 046d:0a44 bus-ID: 00:1f.3
    chip-ID: 8086:a2f0 class-ID: 0300 class-ID: 0403
  Device-2: AMD Baffin HDMI/DP Audio [Radeon RX 550 640SP / 560/560X]
    vendor: XFX Pine driver: snd_hda_intel v: kernel pcie: gen: 3 speed: 8 GT/s
    lanes: 4 link-max: lanes: 8 bus-ID: 03:00.1 chip-ID: 1002:aae0
    class-ID: 0403
  Device-3: Logitech Headset H390 type: USB
    driver: hid-generic,snd-usb-audio,usbhid
  Sound API: ALSA v: k5.15.94-1-MANJARO running: yes
  Sound Server-1: JACK v: 1.9.22 running: no
  Sound Server-2: PulseAudio v: 16.1 running: yes
  Sound Server-3: PipeWire v: 0.3.65 running: yes
Network:
  Device-1: Intel Ethernet I219-V vendor: ASRock driver: e1000e v: kernel
    port: N/A bus-ID: 00:1f.6 chip-ID: 8086:15b8 class-ID: 0200
  IF: eno1 state: up speed: 1000 Mbps duplex: full mac: <filter>
Drives:
  Local Storage: total: 2.96 TiB used: 1.04 TiB (35.2%)
  SMART Message: Required tool smartctl not installed. Check --recommends
  ID-1: /dev/sda maj-min: 8:0 vendor: Western Digital model: WD10EZEX-00ZF5A0
    size: 931.51 GiB block-size: physical: 4096 B logical: 512 B speed: 6.0 Gb/s
    type: N/A serial: <filter> rev: 0A80 scheme: MBR
  ID-2: /dev/sdb maj-min: 8:16 vendor: Samsung model: SSD 860 EVO 250GB
    size: 232.89 GiB block-size: physical: 512 B logical: 512 B speed: 6.0 Gb/s
    type: SSD serial: <filter> rev: 1B6Q scheme: MBR
  ID-3: /dev/sdc maj-min: 8:32 vendor: Samsung model: SSD 870 QVO 1TB
    size: 931.51 GiB block-size: physical: 512 B logical: 512 B speed: 6.0 Gb/s
    type: SSD serial: <filter> rev: 2B6Q
  ID-4: /dev/sdd maj-min: 8:48 type: USB vendor: Toshiba model: MQ01ABD100
    size: 931.51 GiB block-size: physical: 512 B logical: 512 B type: HDD
    rpm: 5400 serial: <filter> scheme: MBR
Partition:
  ID-1: / raw-size: 232.88 GiB size: 228.17 GiB (97.98%)
    used: 36.21 GiB (15.9%) fs: ext4 dev: /dev/sdb1 maj-min: 8:17
  ID-2: /home raw-size: 931.51 GiB size: 915.82 GiB (98.31%)
    used: 608.99 GiB (66.5%) fs: ext4 dev: /dev/sdc maj-min: 8:32
Swap:
  Kernel: swappiness: 60 (default) cache-pressure: 100 (default)
  ID-1: swap-1 type: file size: 512 MiB used: 131 MiB (25.6%) priority: -2
    file: /swapfile
Sensors:
  System Temperatures: cpu: 30.0 C mobo: N/A gpu: amdgpu temp: 40.0 C
  Fan Speeds (RPM): N/A gpu: amdgpu fan: 86
Info:
  Processes: 400 Uptime: 6h 47m wakeups: 23 Memory: 15.56 GiB
  used: 8.79 GiB (56.5%) Init: systemd v: 252 default: graphical
  tool: systemctl Compilers: gcc: 12.2.1 clang: 15.0.7 Packages: 1342
  pm: pacman pkgs: 1297 libs: 357 tools: pamac pm: appimage pkgs: 0 pm: flatpak
  pkgs: 24 pm: snap pkgs: 21 Shell: Bash v: 5.1.16 running-in: alacritty
  inxi: 3.3.25

Do are you connected with the VPN? You’re routing all your traffic through their infrastructure which might be slow.

No, sorry. I should have been clearer.
I use VPN for certain tasks, but mostly I am working off VPN.

These lines when put in /etc/resolv.conf forces to you your VPN’s DNS for all connections…

These commands prevent any modifications of that file.

The permission error is cause due to the above command.
The file will not be recreated, but the default for it is to be a symbolic link to /run/systemd/resolve/stub-resolv.conf

Then you should not make the above changes, but instead create separate connection profiles for the different needs…

  1. VPN connection with it’s routing to your VPN and DNS settings.
  2. Non-VPN connection with your normal routing to your ISP-modem and DNS settings.

If (1) doesn’t seem to work you need to check your VPN settings but at same time allow the traffic to use your ISP-Modem as the gateway, because all traffic needs to pass your modem to be able to go out.

Sorry for being a bit thick.
What you say is that I cannot undo the changes because of the chattr command.
But by running this command:
/run/systemd/resolve/stub-resolv.conf

I can bypass the resolv.conf file?

If that is so, should I put something in the stub-resolv.conf?

No.

You put a write-protected setting on the file /etc/resolv.conf, so it can’t be changed by anyone.
First, you have to undo that:

sudo chattr -i /etc/resolv.conf

Then, you remove this file:

sudo rm /etc/resolv.conf

And reset it to the default value:

sudo ln -sf /run/systemd/resolve/stub-resolv.conf /etc/resolv.conf

Then, enable and activate this DNS resolver:

sudo systemctl enable --now systemd-resolved.service
sudo systemctl restart systemd-resolved.service

At least, then your “normal” internet should work and it will use the DNS servers from your router or ISP.

If you have this running, we could look into either the VPN issue or the slow connection. I’m not sure if it’s a combination of both or separate issues.

Without hardware information, we can only guess.

2 Likes

Thank you!
My internet is back to normal.

This topic was automatically closed 2 days after the last reply. New replies are no longer allowed.