I have modified /etc/hosts file with IP address and hostname entries. However, host command is returning 'Host vhost1.example.com not found: 3(NXDOMAIN)'. Also, apache is returning error on start as '[error] (EAI 2)Name or service not known: Could not resolve host name vhost1.example.com-- ignoring!' . The ssh worked fine and resolved the hostname correctly (ssh from same system to itself - just for test). Am I missing something here? I thought /etc/hosts will be referred for all lookups. Any help??
jM.
Johan Martinez wrote:
I have modified /etc/hosts file with IP address and hostname entries. However, host command is returning 'Host vhost1.example.com not found: 3(NXDOMAIN)'. Also, apache is returning error on start as '[error] (EAI 2)Name or service not known: Could not resolve host name vhost1.example.com-- ignoring!' . The ssh worked fine and resolved the hostname correctly (ssh from same system to itself - just for test). Am I missing something here? I thought /etc/hosts will be referred for all lookups. Any help??
Does /etc/resolv.conf exist? If so, what does /etc/nsswitch.conf say - files first?
mark
On Fri, Apr 8, 2011 at 1:27 PM, m.roth@5-cent.us wrote:
Johan Martinez wrote:
I have modified /etc/hosts file with IP address and hostname entries. However, host command is returning 'Host vhost1.example.com not found: 3(NXDOMAIN)'. Also, apache is returning error on start as '[error] (EAI 2)Name or service not known: Could not resolve host name vhost1.example.com-- ignoring!' . The ssh worked fine and resolved the hostname correctly (ssh from same system to itself - just for test). Am I missing something here? I thought /etc/hosts will be referred for all lookups. Any help??
Does /etc/resolv.conf exist? If so, what does /etc/nsswitch.conf say - files first?
mark
resolv.conf exists and nsswitch.conf has a following line: "hosts: files dns"
SELinux was in enforcing mode, but I didn't see any errors in audit.log. Still I have disabled it for now.
thanks, jM
On Friday 08 April 2011 14:32, the following was written:
On Fri, Apr 8, 2011 at 1:27 PM, m.roth@5-cent.us wrote:
Johan Martinez wrote:
I have modified /etc/hosts file with IP address and hostname entries. However, host command is returning 'Host vhost1.example.com not found: 3(NXDOMAIN)'. Also, apache is returning error on start as '[error] (EAI 2)Name or service not known: Could not resolve host name vhost1.example.com-- ignoring!' . The ssh worked fine and resolved the hostname correctly (ssh from same system to itself - just for test). Am I missing something here? I thought /etc/hosts will be referred for all lookups. Any help??
Does /etc/resolv.conf exist? If so, what does /etc/nsswitch.conf say - files first?
mark
resolv.conf exists and nsswitch.conf has a following line: "hosts: files dns"
Check /etc/host.conf that is the file that tells the system in what order to do it's lookups. Should be as follows:
order hosts,bind
SELinux was in enforcing mode, but I didn't see any errors in audit.log. Still I have disabled it for now.
SELinux shouldn't play a role here.
On 04/08/11 11:24 AM, Johan Martinez wrote:
I have modified /etc/hosts file with IP address and hostname entries. However, host command is returning 'Host vhost1.example.com http://vhost1.example.com not found: 3(NXDOMAIN)'. Also, apache is returning error on start as '[error] (EAI 2)Name or service not known: Could not resolve host name vhost1.example.com http://vhost1.example.com -- ignoring!' . The ssh worked fine and resolved the hostname correctly (ssh from same system to itself - just for test). Am I missing something here? I thought /etc/hosts will be referred for all lookups. Any help??
the 'hosts' command (as well as dig, and nslookup) go directly to DNS, they do not look at /etc/hosts or nsswitch.conf for that matter. Apache may well go to DNS also, since your local /etc/hosts file is not recognized by any systems outside the localhost, and apache IS a server.
This is working fine on another CentOS system. This particular install where host command is failing is trimmed down install using kickstart file. It is working on a system where install is default 'Server non-GUI', option given during interactive CD install. I guess this has to do with some missing package. Any clues??
jM.
On Fri, Apr 8, 2011 at 2:01 PM, John R Pierce pierce@hogranch.com wrote:
On 04/08/11 11:24 AM, Johan Martinez wrote:
I have modified /etc/hosts file with IP address and hostname entries. However, host command is returning 'Host vhost1.example.com http://vhost1.example.com not found: 3(NXDOMAIN)'. Also, apache is returning error on start as '[error] (EAI 2)Name or service not known: Could not resolve host name vhost1.example.com http://vhost1.example.com -- ignoring!' . The ssh worked fine and resolved the hostname correctly (ssh from same system to itself - just for test). Am I missing something here? I thought /etc/hosts will be referred for all lookups. Any help??
the 'hosts' command (as well as dig, and nslookup) go directly to DNS, they do not look at /etc/hosts or nsswitch.conf for that matter. Apache may well go to DNS also, since your local /etc/hosts file is not recognized by any systems outside the localhost, and apache IS a server.
CentOS mailing list CentOS@centos.org http://lists.centos.org/mailman/listinfo/centos
Try flushing DNS cache:
/etc/init.d/nscd restart
On Apr 8, 2011, at 3:31 PM, Johan Martinez wrote:
This is working fine on another CentOS system. This particular install where host command is failing is trimmed down install using kickstart file. It is working on a system where install is default 'Server non-GUI', option given during interactive CD install. I guess this has to do with some missing package. Any clues??
jM.
On Fri, Apr 8, 2011 at 2:01 PM, John R Pierce <pierce@hogranch.commailto:pierce@hogranch.com> wrote: On 04/08/11 11:24 AM, Johan Martinez wrote:
I have modified /etc/hosts file with IP address and hostname entries. However, host command is returning 'Host vhost1.example.comhttp://vhost1.example.com/ <http://vhost1.example.comhttp://vhost1.example.com/> not found: 3(NXDOMAIN)'. Also, apache is returning error on start as '[error] (EAI 2)Name or service not known: Could not resolve host name vhost1.example.comhttp://vhost1.example.com/ <http://vhost1.example.comhttp://vhost1.example.com/> -- ignoring!' . The ssh worked fine and resolved the hostname correctly (ssh from same system to itself - just for test). Am I missing something here? I thought /etc/hosts will be referred for all lookups. Any help??
the 'hosts' command (as well as dig, and nslookup) go directly to DNS, they do not look at /etc/hosts or nsswitch.conf for that matter. Apache may well go to DNS also, since your local /etc/hosts file is not recognized by any systems outside the localhost, and apache IS a server.
_______________________________________________ CentOS mailing list CentOS@centos.orgmailto:CentOS@centos.org http://lists.centos.org/mailman/listinfo/centos
_______________________________________________ CentOS mailing list CentOS@centos.orgmailto:CentOS@centos.org http://lists.centos.org/mailman/listinfo/centos
On Fri, Apr 8, 2011 at 2:39 PM, Dvorkin, Asya dvorkias@umdnj.edu wrote:
Try flushing DNS cache:
/etc/init.d/nscd restart
nscd is not running.
On Apr 8, 2011, at 3:31 PM, Johan Martinez wrote:
This is working fine on another CentOS system. This particular install where host command is failing is trimmed down install using kickstart file. It is working on a system where install is default 'Server non-GUI', option given during interactive CD install. I guess this has to do with some missing package. Any clues??
jM.
On Fri, Apr 8, 2011 at 2:01 PM, John R Pierce pierce@hogranch.com wrote:
On 04/08/11 11:24 AM, Johan Martinez wrote:
I have modified /etc/hosts file with IP address and hostname entries. However, host command is returning 'Host vhost1.example.com http://vhost1.example.com not found: 3(NXDOMAIN)'. Also, apache is returning error on start as '[error] (EAI 2)Name or service not known: Could not resolve host name vhost1.example.com http://vhost1.example.com -- ignoring!' . The ssh worked fine and resolved the hostname correctly (ssh from same system to itself - just for test). Am I missing something here? I thought /etc/hosts will be referred for all lookups. Any help??
the 'hosts' command (as well as dig, and nslookup) go directly to DNS, they do not look at /etc/hosts or nsswitch.conf for that matter. Apache may well go to DNS also, since your local /etc/hosts file is not recognized by any systems outside the localhost, and apache IS a server.
CentOS mailing list CentOS@centos.org http://lists.centos.org/mailman/listinfo/centos
CentOS mailing list CentOS@centos.org http://lists.centos.org/mailman/listinfo/centos
CentOS mailing list CentOS@centos.org http://lists.centos.org/mailman/listinfo/centos
Johan Martinez wrote on Fri, 8 Apr 2011 14:31:32 -0500:
This is working fine on another CentOS system.
It doesn't matter if "it works fine". The host command indeed does dns lookups as John Pierce already pointed out and apache does, too. With your experience level I suggest believing him. It's working on your other system because that hostname is in the resolver cache or can be resolved. You want to use DNS, anyway. For your apache problem: you want to read up on name-based virtual hosts.
Kai