Hi,
I got two Raspberry Pi's running.
Today I did a cat resolv.conf on both result wasn't the same.
I presume result from Pi-hole 2 is correct, while the result from Pi-hole 1 is incorrect. However both Pi-holes appears to working OK.
Any idea / suggestion on how to fix - or it doesn't matter?
Both are running latest version of Beta 6.
Cheers Steen
Pi-hole 1
Cat: resolv.conf: No such file or directory
ls -l resolv.conf shows a strange attributes.
Take a look at ls -la /run/systemd/resolve/resolv.conf and cat /run/systemd/resolve/resolv.conf. If you need sudo to do either of those two commands then you have permission issues.
A symlinked file should still show it's contents (if it's set to readable) when you view the source.
Can you do dig from the terminal on Pi-hole 1?
Edit: This is a similar symlinked setup
dan@Viking:~$ ls -la /etc/resolv.conf
lrwxrwxrwx 1 root root 20 Feb 17 10:22 /etc/resolv.conf -> /mnt/wsl/resolv.conf
dan@Viking:~$ cat /etc/resolv.conf
# This file was automatically generated by WSL. To stop automatic generation of this file, add the following entry to /etc/wsl.conf:
# [network]
# generateResolvConf = false
nameserver 172.29.96.1
dan@Viking:~$ ls -la /mnt/wsl/resolv.conf
-rw-r--r-- 1 root root 197 Feb 16 12:03 /mnt/wsl/resolv.conf
admin@pihole1:~ $ sudo cat /etc/resolv.conf
cat: /etc/resolv.conf: No such file or directory
admin@pihole1:~ $ ls -la /run/systemd/resolve/resolv.conf
ls: cannot access '/run/systemd/resolve/resolv.conf': No such file or directory
admin@pihole1:~ $ sudo ls -la /run/systemd/resolve/resolv.conf
ls: cannot access '/run/systemd/resolve/resolv.conf': No such file or directory
admin@pihole1:~ $ cat /run/systemd/resolve/resolv.conf
cat: /run/systemd/resolve/resolv.conf: No such file or directory
admin@pihole1:~ $ sudo cat /run/systemd/resolve/resolv.conf
cat: /run/systemd/resolve/resolv.conf: No such file or directory
When doing CD into ETC I see the resolv.conf file, but in red and there is a comment as seen in the below.
admin@pihole1:/etc $ ls -la resolv.conf
lrwxrwxrwx 1 root root 32 Dec 20 16:21 resolv.conf -> /run/systemd/resolve/resolv.conf
admin@pihole1:/etc $ dig flurry.com
; <<>> DiG 9.16.48-Debian <<>> flurry.com
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 11783
;; flags: qr aa rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 0, ADDITIONAL: 1
;; OPT PSEUDOSECTION:
; EDNS: version: 0, flags:; udp: 1232
;; QUESTION SECTION:
;flurry.com. IN A
;; ANSWER SECTION:
flurry.com. 2 IN A 0.0.0.0
;; Query time: 35 msec
;; SERVER: ::1#53(::1)
;; WHEN: Sat Feb 17 19:13:22 GMT 2024
;; MSG SIZE rcvd: 55
Then the symlink is broken, and the ls commands showing that there is no source file.
You can try running find /etc/ -xtype l to confirm is resolv.conf shows up as broken.
The dig commands working means that this isn't a big problem. You might have removed the systemd-resolved and the symbolic link was not removed during the package uninstall process.
Hi,
When CD into directory "cd /run/systemd/resolve/" and running the LS command there is no resolve.conf
When running the sugegsted find, I see several resolv.conf
Not sure what to do.