{"id":4379,"date":"2023-07-24T10:00:19","date_gmt":"2023-07-24T10:00:19","guid":{"rendered":"https:\/\/arzhost.com\/blogs\/?p=4379"},"modified":"2026-05-22T12:13:42","modified_gmt":"2026-05-22T07:13:42","slug":"eai_again-temporary-failure-in-name-resolution","status":"publish","type":"post","link":"https:\/\/arzhost.com\/blogs\/eai_again-temporary-failure-in-name-resolution\/","title":{"rendered":"EAI_AGAIN Temporary Failure in Name Resolution"},"content":{"rendered":"<p>When a website name cannot be converted into an <a href=\"https:\/\/en.wikipedia.org\/wiki\/IP_address\" rel=\"nofollow noopener\" target=\"_blank\">IP address<\/a>, the system generates the &#8220;EAI_AGAIN Temporary Failure in Name Resolution&#8221; error. There are numerous reasons why the issue could appear on your machine, even though it can occasionally be caused by a lost internet connection.<\/p>\n<p><u>You can follow the instructions in this tutorial to troubleshoot and resolve the &#8220;EAI_AGAIN Temporary Failure in Name Resolution&#8221; error:<\/u><\/p>\n<ul>\n<li><code>root privileges or sudo<\/code><\/li>\n<li><code>reliable internet access<\/code><\/li>\n<\/ul>\n<p><u>When a user uses a command like &#8220;ping&#8221; to connect to a website, an error occurs:<\/u><\/p>\n<ul>\n<li><code>Ping www.arzhost.com<\/code><\/li>\n<\/ul>\n<p>The system produces an error because it cannot communicate with the DNS server.<\/p>\n<p>Resolv. conf network configuration file issues and firewall configuration issues are the most frequent causes of this error.<\/p>\n<p><u>Below are the methods to correct the problem in both scenarios.<\/u><\/p>\n<p><a href=\"https:\/\/arzhost.com\/blogs\/wp-content\/uploads\/2023\/07\/A-resolv.-conf-configuration-error-Linux-systems.png\"><img fetchpriority=\"high\" decoding=\"async\" class=\"alignnone  wp-image-17775\" src=\"https:\/\/arzhost.com\/blogs\/wp-content\/uploads\/2023\/07\/A-resolv.-conf-configuration-error-Linux-systems-300x157.png\" alt=\"A resolv. conf configuration error Linux systems\u2019\" width=\"950\" height=\"497\" srcset=\"https:\/\/arzhost.com\/blogs\/wp-content\/uploads\/2023\/07\/A-resolv.-conf-configuration-error-Linux-systems-300x157.png 300w, https:\/\/arzhost.com\/blogs\/wp-content\/uploads\/2023\/07\/A-resolv.-conf-configuration-error-Linux-systems-1024x536.png 1024w, https:\/\/arzhost.com\/blogs\/wp-content\/uploads\/2023\/07\/A-resolv.-conf-configuration-error-Linux-systems-768x402.png 768w, https:\/\/arzhost.com\/blogs\/wp-content\/uploads\/2023\/07\/A-resolv.-conf-configuration-error-Linux-systems.png 1200w\" sizes=\"(max-width: 950px) 100vw, 950px\" \/><\/a><\/p>\n<h2><strong>Method 1: A resolv. conf configuration error Linux systems&#8217;<\/strong><\/h2>\n<p>resolv. conf file is used to set up DNS servers.<\/p>\n<p><u>Start by launching the file in a text editor like nano.<\/u><\/p>\n<ul>\n<li><code>nano \/etc\/resolv.conf with sudo<\/code><\/li>\n<\/ul>\n<p><u>Ensure that there is at least one name server in the resolv.conf file. The lines listing name servers ought to appear as follows:<\/u><\/p>\n<ul>\n<li><code>8.8.8 is a name server.<\/code><\/li>\n<\/ul>\n<p>Add at least one name server to the file if you don&#8217;t already have one. Although Google owns the well-known name servers 8.8.8.8 and 8.8.4.4, any working DNS server can be added to this list.<\/p>\n<p><u>Save the file, then shut it down.<\/u><\/p>\n<p><u>Restart the DNS resolver service after that.<\/u><\/p>\n<ul>\n<li><code>restart systemd-resolved. Service with sudo systemctl<\/code><\/li>\n<\/ul>\n<p><u>The aforementioned command outputs nothing if it is successful. Pinging a website will show whether your new name servers are configured properly:<\/u><\/p>\n<ul>\n<li><code>Ping www.arzhost.com<\/code><\/li>\n<\/ul>\n<p>Your DNS server is operational if you can observe data being sent and received using the ping command.<\/p>\n<h3><span class=\"ez-toc-section\" id=\"Incorrect_permissions\"><\/span><strong>Incorrect permissions<\/strong><span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p>If the error still occurs even when your resolv. conf file has the correct DNS servers. It can be caused by improperly set file permissions.<\/p>\n<p><iframe title=\"YouTube video player\" src=\"https:\/\/www.youtube.com\/embed\/UOszyo1EZvs\" width=\"560\" height=\"315\" frameborder=\"0\" allowfullscreen=\"allowfullscreen\"><\/iframe><\/p>\n<p><u>Use the following command to give the root user ownership of the file:<\/u><\/p>\n<ul>\n<li><code>\/etc\/resolv.conf chown root: root with sudo.<\/code><\/li>\n<\/ul>\n<p><u>Change the user permissions to allow everyone to read the file on the system:<\/u><\/p>\n<ul>\n<li><code>Doing sudo chmod 644 on \/etc\/resolv.conf<\/code><\/li>\n<\/ul>\n<p><u>Re-ping a webpage.<\/u><\/p>\n<ul>\n<li><code>Ping www.arzhost.com<\/code><\/li>\n<\/ul>\n<p>The scripts above correctly fix the fault if incorrect file permissions were to blame.<\/p>\n<h2><span class=\"ez-toc-section\" id=\"Method_2_Firewall_Limitations\"><\/span><strong>Method 2: Firewall Limitations<\/strong><span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p>A firewall blocking either one or both of the following ports could be another explanation for the &#8220;<span style=\"color: #000000;\"><strong>EAI_AGAIN Temporary Failure in Name Resolution<\/strong><\/span>&#8221; error:<\/p>\n<ul>\n<li><code>using port 43 for Whois lookup<\/code><\/li>\n<li><code>the domain name resolution port 53<\/code><\/li>\n<\/ul>\n<h3><span class=\"ez-toc-section\" id=\"1_Open_the_port_in_UFW_Firewall\"><\/span><strong><u>1: Open the port in UFW Firewall<\/u><\/strong><span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p><u>To allow traffic on port 43 using the UFW firewall, enter the following command:<\/u><\/p>\n<ul>\n<li><code>ufw allow 43\/tcp sudo<\/code><\/li>\n<\/ul>\n<p><u>The rule has been successfully amended, according to UFW.<\/u><\/p>\n<p><u>For port 53, repeat the command.<\/u><\/p>\n<ul>\n<li><code>ufw allow 53\/tcp sudo<\/code><\/li>\n<\/ul>\n<p><u>Use the following command to reload UFW:<\/u><\/p>\n<ul>\n<li><code>ufw sudo reload<\/code><\/li>\n<\/ul>\n<p>The outcome validates the operation&#8217;s success.<\/p>\n<h3><span class=\"ez-toc-section\" id=\"2_Firewalld_ports_should_be_opened\"><\/span><strong><u>2: Firewalld ports should be opened.<\/u><\/strong><span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p><u>The default firewall in certain Linux distributions, including CentOS, is firewalld. In firewalld, the syntax is as follows:<\/u><\/p>\n<ul>\n<li><code>the command sudo firewall-cmd \u2014add-port=43\/tcp \u2014permanent<\/code><\/li>\n<\/ul>\n<p><u>firewalld prints &#8220;success&#8221; as its output.<\/u><\/p>\n<p><u>For port 53, repeat the command.<\/u><\/p>\n<ul>\n<li><code>the command sudo firewall-cmd \u2014add-port=53\/tcp \u2014permanent<\/code><\/li>\n<\/ul>\n<p><u>Firewall reloading<\/u><\/p>\n<ul>\n<li><code>Firewall-cmd \u2014reload with sudo<\/code><\/li>\n<\/ul>\n<p><u>Pinging a webpage will check the connection.<\/u><\/p>\n<ul>\n<li><code>Ping www.arzhost.com<\/code><\/li>\n<\/ul>\n<h2><span class=\"ez-toc-section\" id=\"Conclusion\"><\/span><strong>Conclusion<\/strong><span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p>This article offered solutions for troubleshooting and resolving Linux&#8217;s &#8220;EAI_AGAIN Temporary Failure in Name Resolution&#8221; problem.<\/p>\n<p>Visit <a href=\"https:\/\/www.arzhost.com\/\">Arzhost<\/a> and read How to Use Linux dig Command for further information on troubleshooting DNS-related issues.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>When a website name cannot be converted into an IP address, the system generates the &#8220;EAI_AGAIN Temporary Failure in Name Resolution&#8221; error. There are numerous reasons why the issue could appear on your machine, even though it can occasionally be caused by a lost internet connection. You can follow the instructions in this tutorial to [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":17773,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[31],"tags":[],"class_list":["post-4379","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-linux"],"_links":{"self":[{"href":"https:\/\/arzhost.com\/blogs\/wp-json\/wp\/v2\/posts\/4379","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/arzhost.com\/blogs\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/arzhost.com\/blogs\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/arzhost.com\/blogs\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/arzhost.com\/blogs\/wp-json\/wp\/v2\/comments?post=4379"}],"version-history":[{"count":4,"href":"https:\/\/arzhost.com\/blogs\/wp-json\/wp\/v2\/posts\/4379\/revisions"}],"predecessor-version":[{"id":17776,"href":"https:\/\/arzhost.com\/blogs\/wp-json\/wp\/v2\/posts\/4379\/revisions\/17776"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/arzhost.com\/blogs\/wp-json\/wp\/v2\/media\/17773"}],"wp:attachment":[{"href":"https:\/\/arzhost.com\/blogs\/wp-json\/wp\/v2\/media?parent=4379"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/arzhost.com\/blogs\/wp-json\/wp\/v2\/categories?post=4379"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/arzhost.com\/blogs\/wp-json\/wp\/v2\/tags?post=4379"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}