Resolv.conf resetting to empty dns

okay I swear I solved this before but I changed some settings around with my dns to get my pi-hole-standalone to work but now everytime I reboot or put in terminal sudo resolvconf -u my only nameserver is 127.0.0.1 and I have to edit resolve.conf and add in some dns’s to get internet to work again any help is appreciated

edit: including some info

System:
  Kernel: 5.8.0-2-MANJARO x86_64 bits: 64 compiler: N/A 
  parameters: BOOT_IMAGE=/boot/vmlinuz-5.8-x86_64 
  root=UUID=9ba3defc-19c7-4c89-a71f-0734b217f4d7 rw apparmor=1 
  security=apparmor udev.log_priority=3 
  Desktop: Cinnamon 4.6.7 tk: GTK 3.24.22 dm: LightDM 1.30.0 
  Distro: Manjaro Linux 
Machine:
  Type: Desktop System: Dell product: OptiPlex 390 v: 01 serial: <filter> 
  Chassis: type: 3 serial: <filter> 
  Mobo: Dell model: 0M5DCD v: A00 serial: <filter> BIOS: Dell v: A06 
  date: 03/27/2012 
CPU:
  Topology: Quad Core model: Intel Core i5-2400 bits: 64 type: MCP 
  arch: Sandy Bridge family: 6 model-id: 2A (42) stepping: 7 microcode: 2F 
  L2 cache: 6144 KiB 
  flags: avx lm nx pae sse sse2 sse3 sse4_1 sse4_2 ssse3 vmx bogomips: 24753 
  Speed: 1596 MHz min/max: 1600/3400 MHz Core speeds (MHz): 1: 1596 2: 1868 
  3: 1596 4: 1596 
  Vulnerabilities: Type: itlb_multihit status: KVM: Split huge pages 
  Type: l1tf 
  mitigation: PTE Inversion; VMX: conditional cache flushes, SMT disabled 
  Type: mds mitigation: Clear CPU buffers; SMT disabled 
  Type: meltdown mitigation: PTI 
  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: Full generic retpoline, IBPB: conditional, 
  IBRS_FW, STIBP: disabled, RSB filling 
  Type: srbds status: Not affected 
  Type: tsx_async_abort status: Not affected 
Graphics:
  Device-1: NVIDIA GK208B [GeForce GT 710] vendor: Micro-Star MSI 
  driver: nvidia v: 440.100 alternate: nouveau,nvidia_drm bus ID: 01:00.0 
  chip ID: 10de:128b 
  Display: x11 server: X.Org 1.20.8 driver: nvidia display ID: :0 screens: 1 
  Screen-1: 0 s-res: 3600x1093 s-dpi: 96 s-size: 953x289mm (37.5x11.4") 
  s-diag: 996mm (39.2") 
  Monitor-1: VGA-0 res: 1680x1050 hz: 60 dpi: 90 
  size: 474x296mm (18.7x11.7") diag: 559mm (22") 
  Monitor-2: DVI-D-0 res: 1920x1080 hz: 60 dpi: 92 
  size: 531x299mm (20.9x11.8") diag: 609mm (24") 
  OpenGL: renderer: GeForce GT 710/PCIe/SSE2 v: 4.6.0 NVIDIA 440.100 
  direct render: Yes 
Audio:
  Device-1: Intel 6 Series/C200 Series Family High Definition Audio 
  vendor: Dell driver: snd_hda_intel v: kernel bus ID: 00:1b.0 
  chip ID: 8086:1c20 
  Device-2: NVIDIA GK208 HDMI/DP Audio vendor: Micro-Star MSI 
  driver: snd_hda_intel v: kernel bus ID: 01:00.1 chip ID: 10de:0e0f 
  Sound Server: ALSA v: k5.8.0-2-MANJARO 
Network:
  Device-1: Realtek RTL8111/8168/8411 PCI Express Gigabit Ethernet 
  vendor: Dell driver: r8169 v: kernel port: 2000 bus ID: 04:00.0 
  chip ID: 10ec:8168 
  IF: enp4s0 state: up speed: 100 Mbps duplex: full mac: <filter> 
  Device-2: Realtek RTL8192EU 802.11b/g/n WLAN Adapter type: USB 
  driver: rtl8xxxu bus ID: 1-1.4:3 chip ID: 0bda:818b serial: <filter> 
  IF: wlp0s26u1u4 state: down mac: <filter> 
  IF-ID-1: tun0 state: unknown speed: 10 Mbps duplex: full mac: N/A 
Drives:
  Local Storage: total: 2.73 TiB used: 13.28 GiB (0.5%) 
  SMART Message: Required tool smartctl not installed. Check --recommends 
  ID-1: /dev/sda vendor: Hitachi model: HUA721010KLA330 size: 931.51 GiB 
  block size: physical: 512 B logical: 512 B speed: 3.0 Gb/s 
  serial: <filter> rev: AB0A 
  ID-2: /dev/sdb vendor: Western Digital model: WD2003FZEX-00Z4SA0 
  size: 1.82 TiB block size: physical: 4096 B logical: 512 B 
  speed: <unknown> rotation: 7200 rpm serial: <filter> rev: 1A01 scheme: MBR 
Partition:
  ID-1: / raw size: 100.00 GiB size: 97.93 GiB (97.93%) 
  used: 9.84 GiB (10.0%) fs: ext4 dev: /dev/sdb1 
  ID-2: /home raw size: 1.68 TiB size: 1.66 TiB (98.37%) 
  used: 3.44 GiB (0.2%) fs: ext4 dev: /dev/sdb3 
Swap:
  Alert: No Swap data was found. 
Sensors:
  System Temperatures: cpu: 42.0 C mobo: N/A gpu: nvidia temp: 39 C 
  Fan Speeds (RPM): N/A gpu: nvidia fan: 50% 
Info:
  Processes: 190 Uptime: 34m Memory: 7.75 GiB used: 1.94 GiB (25.1%) 
  Init: systemd v: 245 Compilers: gcc: 10.1.0 Packages: pacman: 1125 
  lib: 289 flatpak: 0 Shell: Bash v: 5.0.18 running in: gnome-terminal 
  inxi: 3.1.05

Are you using resolvconf or systemd-resolvconf ?

pacman -Qs resolv
local/geoip 1.6.12-2
    Non-DNS IP-to-country resolver C library & utils
local/python-geoip 1.3.2-8
    Python bindings for the GeoIP IP-to-country resolver library
local/python-resolvelib 0.4.0-1
    Resolve abstract dependencies into concrete ones
local/systemd-resolvconf 245.7-2
    systemd resolvconf replacement (for use with systemd-resolved)

OK.
So … you want to set a specific DNS server(s) for always?
Then do the following

First, lets back up your resolvconf

sudo mv /etc/resolv.conf /etc/resolv.conf.bak

Then lets make sure the file is a link to be handled by systemd and such:

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

Then create the file

/etc/systemd/resolved.conf.d/dns_servers.conf

with content (using your DNS in place of cloudflares)

[Resolve]
DNS=1.1.1.1 1.0.0.1  ## put your own DNS here, separated by spaces
Domains=~.

and then restart, check, etc


Instead … You could of course always just make the file immutable I guess, ex:

sudo chattr +i /etc/resolv.conf

This is confusing:

the resolvconf command from systemd does not have a ‘-u’ option:

   -u, -I, -i, -l, -R, -r, -v, -V, --enable-updates, --disable-updates, --are-updates-enabled
       These switches are not supported and the command will fail if used.

Therefore: The resolvconf command you are using can not be from package systemd-resolvconf

2 Likes

Oo. good catch.

@minty_64 I should have thought to ask this way …

pacman -Qo resolvconf

/usr/bin/resolvconf is owned by openresolv 3.10.0-1

setting chatter messes with my vpn as it changes dns temporarily and the first option didn’t work and had to revert

really odd that package didnt show up when we did pacman -Qs resolv
Especially since these 2 conflict with eachother and should not be able to be installed at the same time:

I had to reinstall so currently I’m using openresolv, the reason stated above is I installed pi-hole-standalone and I forgot how I did it but I got the resolv.conf to stay even after reboot.

With openresolv you probably want to do something like this:

1 Like

went threw the guide step by step and still need to go into /etc/resolv.conf to add a dns that lets me load a web page
edit: at least I have 127.0.0.1 in the file upon reset though isn’t much constellation.

1 Like

did a bit of searching and it seems resolve pulls from /etc/resolv.conf.head and appending my nameservers into that file I created puts them in resolve.conf

I’m having the same issue myself. I was trying all this and I wasn’t having much luck because I wasn’t doing something correctly. So, I tried opening the GUI Network Configuration Utility, went to settings, then IPv4 settings tab, then I put in the DNS servers manually there, saved and rebooted the system and I was able to connect again.

yes … network manager has the functionality to set ‘manual’ DNS servers per connection …

But really that isnt what this thread is about …

1 Like

Understood, I just figured if someone was in a jam it’s a decent temporary fix until it can be figured out via this method.

OK - no floggings this time :wink:

1 Like