Some specifications and background information: Running Centos Linux release 7.2.1511 (core), Static IP address, Dedicated server machine not configured by me, also I have very little linux experience.
I am trying to set up the server to host a tomcat web application that uses a MySQL database. However whenever I try to install the required software I get a "Could not resolve host error". I have tried multiple suggestions and the solutions in a previous similar question: Could not resolve host. However none seem to work.
I can successfully ping my local host 127.0.0.1, but not googles public nameserver 8.8.8.8. When I try ping 8.8.8.8 and the public-gateway address there is 100% packet loss. Which in the previous question's answer indicates the local network configuration is wrong and you'll have to check the configuration. Below is the local network configuration:
Network information
[xxxx]$ nmcli d
DEVICE TYPE STATE CONNECTION
enp3s0 ethernet connected enp3s0
lo loopback unmanaged --
[xxxx]$ ip a
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN
link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
inet 127.0.0.1/8 scope host lo
valid_lft forever preferred_lft forever
inet6 ::1/128 scope host
valid_lft forever preferred_lft forever
2: enp3s0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP qlen 1000
My etc/resolv.conf
file contains
nameserver 8.8.8.8
nameserver 127.0.0.1
host google.com
simply results in: -bash: host: command not found
This is also the case with the nslookup and dig commands.
Output:
[xxxx]$ sudo yum update
Loaded plugins: fastestmirror
http://ca.mirror.babylon.network/centos/7.2.1511/os/x86_64/repodata/repomd.xml: [Errno 14] curl#6 - "Could not resolve host: ca.mirror.babylon.network; Unknown error"
Trying other mirror.
http://mirror.netaddicted.ca/CentOS/7.2.1511/os/x86_64/repodata/repomd.xml: [Errno 14] curl#6 - "Could not resolve host: mirror.netaddicted.ca; Unknown error"
Trying other mirror.
etc...
firewall-cmd --list-all
[xxxx]$ firewall-cmd --list-all
public (default, active)
interfaces: enp3s0
sources:
services: dhcpv6-client http https ssh
ports: 10000/tcp
masquerade: no
forward-ports:
icmp-blocks:
rich rules:
google's public nameserver ping failure
[xxxx]$ ping 8.8.8.8
PING 8.8.8.8 (8.8.8.8) 56(84) bytes of data.
^C
--- 8.8.8.8 ping statistics ---
8 packets transmitted, 0 received, 100% packet loss, time 6999ms
Local gateway ping failure
[xxxx]$ ping xxx.xxx.xx.xxx
...
11 packets transmitted, 0 received, 100% packet loss, time 9999ms
Further specification and update: The server is connected to a larger network managed by an IT department. I am currently contacting one of the IT employees to ensure the firewall is open for this server.
I hope this is relevant and useful information. Thanks in advance for you time. I will update the question once I know if the problem was on the IT staff side and the firewall configuration.
Final Update: This error was in fact due to the firewall configuration. Once the IT staff allowed access there was no longer any issue.