/etc/host & /etc/hostname files and dual NIC server

Latest response

I have a rhel 7.0 system with two NICs. NIC-1 is "bound" to my public static IP addresss. The other NIC (NIC-0) is "bound" to an 192.168.xxx.xxx internal LAN address.
I have the Firewalld service enabled with the External Zone "bound" to NIC-1, and the Internal Zone "bound" to NIC-0.
NAT and IP masquerading is "turned on".
I have also defined two domains an external one (ids4zos.net) and an internal domain (richkids.net)
In the /etc/host file are the following entries:
69.54.xxx.xxx redriver01 redriver01.ids4zos.net
192.168.10.6 redriver00 redriver00.richkids.net
127.0.0.1 localhost localhost.localdomain

In the /etc/hostname ... :
69.54.xxx.xxx redriver01.ids4zos.net redriver01
192.168.10.6 redriver00.richkids.net redriver00

However I'm wondering if this is defined correctly
There are no apparent problems.
However if anyone has any suggestions an/or ideas on how better to config this environment I would be most appreciative.

Best Regards

Guy

Responses

Hello

Edit: I just noticed, you have /etc/host, I think that should be /etc/hosts

The /etc/hosts/ looks different to mine and the example in the man page. It looks like you have the FQDN and the hostname swopped.

The contents of the /etc/hostname file looks strange. If we look in the man page:

man hostname

It says, in "The FQDN" section:

The recommended method of setting the FQDN is to make the hostname be an alias for the fully qualified name using /etc/hosts, DNS, or NIS. For example, if the
hostname was "ursula", one might have a line in /etc/hosts which reads

          127.0.1.1    ursula.example.com ursula

So that example does not match your /etc/hosts/ contents, and then further down in the man page:

FILES
/etc/hostname Historically this file was supposed to only contain the hostname and not the full canonical FQDN. Nowadays most software is able to cope with a full FQDN here. This file is read at boot time by the system initialization scripts to set the hostname.

   /etc/hosts Usually, this is where one sets the domain name by aliasing the host name to the FQDN.

HTH

Hi Stephen.
Thank you for the clarification.
However when I issue a "host" command for my internally defined domain (richkids.net)
I get the IP addrs of a registered richkids.net
I was using richkids.net on my linux server because I have five windows 7 machines on my internal LAN and they all use the windows group name of richkids. However I guess a windows group name is NOT the same as a domain name.
I'll have to go back to the "drawing board" and figure it out.
Thanks again for your help

Close

Welcome! Check out the Getting Started with Red Hat page for quick tours and guides for common tasks.