One thing that can cause this error is specifying a gateway or other network value on an invalid subnet. For example, it looks like your gateway is on the 192.168.1.0/24 subnet; if you try to set a static IP for your device on the 192.168.0.0/24 subnet by mistake that could cause this.
Copy and paste the rest of the DietPi-Config page into the thread so we can take a look and maybe help you spot a misconfiguration. This is the page I mean:
Tested with backup raspberry pi 3 and got the same result!
Output:
[ INFO ] DietPi-WiFiDB | Applied WiFi DB slot 0 with SSID ""
[ INFO ] DietPi-WiFiDB | Applied WiFi DB slot 1 with SSID ""
[ INFO ] DietPi-WiFiDB | Applied WiFi DB slot 2 with SSID ""
[ INFO ] DietPi-WiFiDB | Applied WiFi DB slot 3 with SSID ""
[ INFO ] DietPi-WiFiDB | Applied WiFi DB slot 4 with SSID ""
[ SUB1 ] DietPi-Services > stop
[ OK ] DietPi-Services | stop : cron
[ SUB1 ] DietPi-Set_hardware > wifimodules (disable)
[ OK ] DietPi-Set_hardware | Desired setting in /boot/config.txt was already set: dtoverlay=disable-wifi
[ OK ] wifimodules disable | Completed
[ OK ] DietPi-Config | Dropping connections, please wait...
RTNETLINK answers: No such process
And /etc/resolv.conf had these values. But I flashed the drive and tried again.
nameserver 8.8.8.8
nameserver 8.8.4.4
2nd try
I tried to change it manually but no progress goes back to even if I remove and wrote it back:
domain lan
search lan
nameserver 192.168.1.1
I edited the /etc/network/interfaces and changed the dns-nameservers, and on the interface got this after the change:
Try the following and post the output: ip -4 ad; ip -4 ro; nslookup dietpi.com 192.168.0.1; nslookup dietpi.com 192.168.1.1; nslookup dietpi.com 8.8.8.8; ping -c 4 8.8.8.8
root@DietPi:~# ip -4 ad; ip -4 ro; nslookup dietpi.com 192.168.0.1; nslookup dietpi.com 192.168.1.1; nslookup dietpi.com 8.8.8.8; ping -c 4 8.8.8.8
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1000
inet 127.0.0.1/8 scope host lo
valid_lft forever preferred_lft forever
2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP group default qlen 1000
inet 192.168.1.218/24 brd 192.168.1.255 scope global dynamic eth0
valid_lft 3262sec preferred_lft 3262sec
default via 192.168.1.1 dev eth0
192.168.1.0/24 dev eth0 proto kernel scope link src 192.168.1.218
-bash: nslookup: command not found
-bash: nslookup: command not found
-bash: nslookup: command not found
PING 8.8.8.8 (8.8.8.8) 56(84) bytes of data.
64 bytes from 8.8.8.8: icmp_seq=1 ttl=60 time=16.4 ms
64 bytes from 8.8.8.8: icmp_seq=2 ttl=60 time=16.3 ms
64 bytes from 8.8.8.8: icmp_seq=3 ttl=60 time=16.1 ms
64 bytes from 8.8.8.8: icmp_seq=4 ttl=60 time=16.4 ms
--- 8.8.8.8 ping statistics ---
4 packets transmitted, 4 received, 0% packet loss, time 3005ms
rtt min/avg/max/mdev = 16.108/16.310/16.443/0.132 ms
Alright, it works fine now.
Either edit the /etc/network/interfaces or use dietpi-config, just keep in mind that the second will overwrite the first. It would be safer option to use DHCP though if you are not sure what to use. However the gateway and dns is 192.168.1.1 which should be your ISP router.
Thank you all. I only use DHCP. So changing the /etc/network/interfaces it will update the DNS and ignores /etc/resolv.conf ?
Iβm asking this because it doesnβt took effect. I ping to 1337x.to and I get blocked by ISP because Iβm using their DNS. If I change to another DNS it bypasses the block. I have in multiple devices with the google DNS and its working.
root@DietPi:~# dig 1337x.to
; <<>> DiG 9.16.27-Debian <<>> 1337x.to
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 48831
;; flags: qr rd ra; QUERY: 1, ANSWER: 4, AUTHORITY: 3, ADDITIONAL: 19
;; OPT PSEUDOSECTION:
; EDNS: version: 0, flags:; udp: 4096
;; QUESTION SECTION:
;1337x.to. IN A
;; ANSWER SECTION:
1337x.to. 3 IN CNAME 1337x.to.legal.vodafone.pt.
1337x.to.legal.vodafone.pt. 86 IN CNAME legal.vodafone.pt.
legal.vodafone.pt. 18 IN CNAME kju8m5a.impervadns.net.
kju8m5a.impervadns.net. 30 IN A 45.60.74.62
;; AUTHORITY SECTION:
impervadns.net. 3709 IN NS ns1.impervadns.net.
impervadns.net. 3709 IN NS ns3.impervadns.net.
impervadns.net. 3709 IN NS ns2.impervadns.net.
;; ADDITIONAL SECTION:
ns1.impervadns.net. 2905 IN A 198.143.61.164
ns1.impervadns.net. 2905 IN A 198.143.61.165
ns1.impervadns.net. 2905 IN A 198.143.61.166
ns1.impervadns.net. 2905 IN A 198.143.61.64
ns1.impervadns.net. 2905 IN A 198.143.61.65
ns1.impervadns.net. 2905 IN A 198.143.61.66
ns2.impervadns.net. 2905 IN A 198.143.62.165
ns2.impervadns.net. 2905 IN A 198.143.62.166
ns2.impervadns.net. 2905 IN A 198.143.62.64
ns2.impervadns.net. 2905 IN A 198.143.62.65
ns2.impervadns.net. 2905 IN A 198.143.62.66
ns2.impervadns.net. 2905 IN A 198.143.62.164
ns3.impervadns.net. 1240 IN A 198.143.63.165
ns3.impervadns.net. 1240 IN A 198.143.63.166
ns3.impervadns.net. 1240 IN A 198.143.63.64
ns3.impervadns.net. 1240 IN A 198.143.63.65
ns3.impervadns.net. 1240 IN A 198.143.63.66
ns3.impervadns.net. 1240 IN A 198.143.63.164
;; Query time: 16 msec
;; SERVER: 192.168.1.1#53(192.168.1.1)
;; WHEN: Sun Sep 18 12:33:13 BST 2022
;; MSG SIZE rcvd: 485
This is your issue. DNS Server settings will be provided by your DHCP server. Changing them manually on the system will not have any effect. You would need to switch to STATIC IP to be able to set own DNS server on your system.
This basically kicks you off the network. If you want to use this configuration option for setting the DNS servers, you need to change the other network options as well (Static IP and Static Gateway IP) because the default settings are not correct.
An easy way to do this is to use the βcopyβ function to set the values you already have as the values used in your new static configuration. Otherwise just change them manually.
I agree with Joulinar, if possible the best way to set the DNS server for your network is on the gateway (Iβm assuming your gateway is the DHCP server). Log in to your router admin portal and change the DNS server there. This has the additional benefit of setting the nameserver you prefer on any other devices connected to your network.
If you want to change the DNS server on only the DietPi system, or changing the nameserver on the gateway is not possible or otherwise undesirable, you can go ahead with setting the static IP configuration as you are doingβbut you should still log in to your routerβs admin portal to set a DHCP reservation for the DietPiβs IP address to ensure you donβt run into an address conflict down the road.