-1

I have a CentOS 7.7 server up and running, which I am trying to access from other CentOS machines on LAN. Unfortunately, I am not able to reach the hostname from other machines. How can I solve this problem?

Server (CentOS 7.7):

$ hostname
centos77-server-1.localdomain

Client (CentOS 7.7):

# ping centos77-server-1.localdomain
PING localhost (127.0.0.1) 56(84) bytes of data.
64 bytes from localhost (127.0.0.1): icmp_seq=1 ttl=64 time=0.089 ms
64 bytes from localhost (127.0.0.1): icmp_seq=2 ttl=64 time=0.104 ms
64 bytes from localhost (127.0.0.1): icmp_seq=3 ttl=64 time=0.115 ms
64 bytes from localhost (127.0.0.1): icmp_seq=4 ttl=64 time=0.053 ms

As you can see my pinging is resolving as 127.0.0.1 which does not look right, as the server is on 192.168.3.59.

Is there a network configuration gone wrong on my router not allowing hostnames to be reached internally?

enter image description here

kenlukas
  • 3,101
  • 2
  • 16
  • 26
JavaCake
  • 111
  • 3
  • 11

1 Answers1

1

Depending on how your setup is done (DHCP and DNS configuration), you could simply use the internal IP of your machine to connect instead of it's hostname. The problem with this solution is that if you're using DHCP without IP Reservations, your IP will change from time to time.

To check your internal IP on your CentOS Machine run :

ip addr show 

This will most likely output several IPs, it's important that you pick the right one. In most cases, you will have 2 different IPs. One for localhost (127.0.0.1) which is a loop-back address. And you will have your server internal IP as well. Here is sample output, with the correct IP outlined :

enter image description here

Dexirian
  • 430
  • 2
  • 11
  • I have to use the hostname, this is something required by the software i am interfacing with, so the IP is not an option.. – JavaCake Jan 29 '20 at 20:51
  • Your initial ping resolved to 127.0.0.1, which is your local loopback address, do the machines have the same hostname? – Dexirian Jan 29 '20 at 21:05
  • They do not have the same hostname, which is why i am confused that it does resolve to the same hostname.. – JavaCake Jan 30 '20 at 11:11