
Let’s break down the process of fixing the “Temporary failure in name resolution” error by modifying the /etc/resolv.conf file and restarting the systemd-resolved service.
Understanding the Problem: “Temporary failure in name resolution”
This error indicates that your system cannot translate domain names (like [geçersiz URL kaldırıldı]) into IP addresses (like 172.217.160.142). This translation is the job of the Domain Name System (DNS). When your system can’t reach a DNS server or there’s a problem with the DNS configuration, you encounter this error, preventing you from accessing websites and other network resources by name.
The Solution: Modifying /etc/resolv.conf and Restarting systemd-resolved
-
/etc/resolv.conf– The DNS Configuration File: This file contains the DNS settings for your system. The most important setting here isnameserver, which specifies the IP address of a DNS server. -
Adding Google Public DNS Servers: By adding
nameserver 8.8.8.8andnameserver 8.8.4.4to/etc/resolv.conf, you’re instructing your system to use Google Public DNS servers. These are reliable and widely available DNS servers.8.8.8.8: Google Public DNS primary server.8.8.4.4: Google Public DNS secondary server.
-
The
nanoCommand:sudo nano /etc/resolv.confopens the/etc/resolv.conffile in thenanotext editor with root privileges (required to modify system files). -
Restarting
systemd-resolved:sudo systemctl restart systemd-resolved.servicerestarts thesystemd-resolvedservice. This service is responsible for resolving domain names on systems using systemd (which is most modern Linux distributions). Restarting it ensures that the changes you made to/etc/resolv.confare applied.
Step-by-step Instructions:
-
Open your terminal.
-
Edit the
/etc/resolv.conffile:Bashsudo nano /etc/resolv.conf -
Add the following lines at the end of the file:
nameserver 8.8.8.8 nameserver 8.8.4.4If there are other
nameserverlines in this file, adding these lines below them will prioritize Google’s DNS servers. -
Save the file (in
nano, press Ctrl+X, then Y, then Enter). -
Restart the
systemd-resolvedservice:Bashsudo systemctl restart systemd-resolved.service -
Test your internet connection by trying to access a website.
Important Note: On many modern Linux systems that use systemd-resolved, directly editing /etc/resolv.conf is not the recommended long-term solution. The file is often dynamically generated. Changes made directly to this file may be overwritten on reboot or network changes.
A More Permanent Solution (using resolved.conf):
A better approach is to modify /etc/systemd/resolved.conf and then restart the service.
- Edit
/etc/systemd/resolved.conf:Bashsudo nano /etc/systemd/resolved.conf - Uncomment (remove the
#) and change theDNS=lines to:DNS=8.8.8.8 8.8.4.4 #FallbackDNS= - Restart the
systemd-resolvedservice:Bashsudo systemctl restart systemd-resolved.service
This method ensures that your DNS settings persist across reboots.











