Fix the HTTPD “Name or service not known” problem

Resolve error name or service not known
Difficulty

Once you have set up a new domain you will be faced with this error when starting the apache web server:

[Thu May 14 12:38:13.857474 2020] [core:error] [pid 363:tid 140015465703168]
(EAI 2)Name or service not known: AH00547: Could not resolve  name {yourdomain.it} -- ignoring!


All this even if the domain you have configured is apparently correct.

<VirtualHost yourdomain.it:80>
    DocumentRoot "/opt/httpd/htdocs/yourapp"
    ErrorLog "logs/error_log"
    ErrorDocument 404 /
</VirtualHost>

The solution is located under one of the server configurations:

/etc/hosts


In it, the new domain created to be recognized by the Apache web server must be registered.
Once this is done, simply restart the server again and the error will disappear:

httpd -k restart


That’s all.

0
Be the first one to like this.
Please wait...

Leave a Reply

Thanks for choosing to leave a comment.
Please keep in mind that all comments are moderated according to our comment policy, and your email address will NOT be published.
Please do NOT use keywords in the name field. Let's have a personal and meaningful conversation.