Cannot Resolve Hostnames centos 7 minimal

Issues related to configuring your network
Post Reply
ptunstall
Posts: 4
Joined: 2019/07/01 02:59:32

Cannot Resolve Hostnames centos 7 minimal

Post by ptunstall » 2019/07/01 03:15:33

Hi i'm a bit new to centos and linux in general. I have a small home network with a few linux and windows machines. All is well with windows 10 and linux MINT but with centos I cannot ping it's hostname from my other computers and I cannot ping other computers' hostnames from the centos machine.

I have the system setup with a static IP with these settings:

Code: Select all

Address: 192.168.1.119/24
Gateway: 192.168.1.1
DNS Server 1: 192.168.1.1
DNS Server 2: 8.8.8.8
DNS Server 3: 8.8.4.4
this is my optput from nslookup:

Code: Select all

[ptunstall@wham02 ~]$ nslookup wham02
Server:         192.168.1.1
Address:        192.168.1.1#53

** server can't find wham02: NXDOMAIN
Here is my output from hostnamectl:

Code: Select all

[ptunstall@wham02 ~]$ hostnamectl
   Static hostname: wham02
         Icon name: computer-server
           Chassis: server
        Machine ID: 9c20cd5a630b4cc69c43d8471625e5ed
           Boot ID: f449b5bc010d402c830f4f8d145f48c5
  Operating System: CentOS Linux 7 (Core)
       CPE OS Name: cpe:/o:centos:centos:7
            Kernel: Linux 3.10.0-957.21.3.el7.x86_64
      Architecture: x86-64
...and here is my hosts file that I have not touched:

Code: Select all

127.0.0.1   localhost localhost.localdomain localhost4 localhost4.localdomain4
::1         localhost localhost.localdomain localhost6 localhost6.localdomain6
Here is my output from ip addr:

Code: Select all

[ptunstall@wham02 ~]$ ip addr
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1000
    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: eno1: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc mq state UP group default qlen 1000
    link/ether ac:1f:6b:94:8c:fc brd ff:ff:ff:ff:ff:ff
    inet 192.168.1.119/24 brd 192.168.1.255 scope global noprefixroute eno1
       valid_lft forever preferred_lft forever
    inet6 fe80::c037:767f:49d5:5d6d/64 scope link noprefixroute
       valid_lft forever preferred_lft forever
3: eno2: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc mq state DOWN group default qlen 1000
    link/ether ac:1f:6b:94:8c:fd brd ff:ff:ff:ff:ff:ff
4: virbr0: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc noqueue state DOWN group default qlen 1000
    link/ether 52:54:00:93:6c:86 brd ff:ff:ff:ff:ff:ff
    inet 192.168.122.1/24 brd 192.168.122.255 scope global virbr0
       valid_lft forever preferred_lft forever
5: virbr0-nic: <BROADCAST,MULTICAST> mtu 1500 qdisc pfifo_fast master virbr0 state DOWN group default qlen 1000
    link/ether 52:54:00:93:6c:86 brd ff:ff:ff:ff:ff:ff
A lot of my googling has been mentioning editing the resolv.conf file so here is that files output:

Code: Select all

# Generated by NetworkManager
search 192.168.1.1
nameserver 192.168.1.1
nameserver 8.8.8.8
nameserver 8.8.4.4
This system is a GPU render cluster for Octane Render that has a "slave daemon" installed that isn't working because of this hostname issue. I hope I've provided enough info and I hope I havent broken any rules with my post. I greatly appreciate any help/support anyone has to offer.

User avatar
TrevorH
Site Admin
Posts: 33216
Joined: 2009/09/24 10:40:56
Location: Brighton, UK

Re: Cannot Resolve Hostnames centos 7 minimal

Post by TrevorH » 2019/07/01 06:21:46

Nothing registers machines in DNS automatically. You have to do it.
The future appears to be RHEL or Debian. I think I'm going Debian.
Info for USB installs on http://wiki.centos.org/HowTos/InstallFromUSBkey
CentOS 5 and 6 are deadest, do not use them.
Use the FAQ Luke

ptunstall
Posts: 4
Joined: 2019/07/01 02:59:32

Re: Cannot Resolve Hostnames centos 7 minimal

Post by ptunstall » 2019/07/01 06:28:58

Googled "centos register DNS" pulled this up: viewtopic.php?t=54125

sounds like he was having the same/similiar issue but he never shared his solution.

I will try this and see what happens: http://robaker.blogspot.com/2012/11/aut ... -from.html

Thanks for the heads up.

ptunstall
Posts: 4
Joined: 2019/07/01 02:59:32

Re: Cannot Resolve Hostnames centos 7 minimal

Post by ptunstall » 2019/07/01 06:48:53

I followed those two links as well as found another post where you suggested the "DHCP_HOSTNAME" addition. Here is my "ifcfg-eno1" file:

Code: Select all

TYPE=Ethernet
PROXY_METHOD=none
BROWSER_ONLY=no
BOOTPROTO=none
DEFROUTE=yes
IPV4_FAILURE_FATAL=no
IPV6INIT=yes
IPV6_AUTOCONF=yes
IPV6_DEFROUTE=yes
IPV6_FAILURE_FATAL=no
IPV6_ADDR_GEN_MODE=stable-privacy
NAME=eno1
UUID=428c95b0-fc11-4798-8ef4-e1d2194063fd
DEVICE=eno1
ONBOOT=yes
IPADDR=192.168.1.119
PREFIX=24
GATEWAY=192.168.1.1
DNS1=192.168.1.1
IPV6_PRIVACY=no
DNS2=8.8.8.8
DNS3=8.8.4.4
DHCP_HOSTNAME=wham02
Rebooted the machine, no change.

I'm assuming I'm messing a step?

ptunstall
Posts: 4
Joined: 2019/07/01 02:59:32

Re: Cannot Resolve Hostnames centos 7 minimal

Post by ptunstall » 2019/07/01 07:36:14

Did a bit more digging. I think I'm getting closer as I found this: https://possiblelossofprecision.net/?p=1377 which shows what you've told others BUT they mention that it doesn't work if you're setting a STATIC IP and they point you to use "nsupdate". I tried and I get this:

Code: Select all

[ptunstall@wham02 ~]$ nsupdate
> server 192.168.1.1
> update add wham02 86400 A 192.168.1.117
> show
Outgoing update query:
;; ->>HEADER<<- opcode: UPDATE, status: NOERROR, id:      0
;; flags:; ZONE: 0, PREREQ: 0, UPDATE: 0, ADDITIONAL: 0
;; UPDATE SECTION:
wham02.                 86400   IN      A       192.168.1.117

> send
response to SOA query was unsuccessful

Post Reply