[arch-general] Confusion About /etc/hosts File
I have never understood Arch's approach to properly setting a FQDN on a server. According to the Wiki...and I will quote: "Add your hostname, coinciding with the one specified in /etc/rc.conf, as an alias, so that it looks like this: 127.0.0.1 localhost.localdomain localhost yourhostname If you use a static IP, add another line using the syntax: <static-IP> <hostname.domainname.org> <hostname> e.g.: 192.168.1.100 yourhostname.domain.org yourhostname" Now this does not work for me and maybe I am not understanding this but my server hostname is "mail" and it will be managing a domain called "iamghost.com" so I need my output of the command 'hostname -f' to result in 'mail.iamghost.com' and when I follow the guide, that is not what I get. Obviously my server has a static IP so I followed the Wiki as shown below: #<ip-address> <hostname.domain.org> <hostname> 127.0.0.1 localhost.localdomain localhost mail 10.1.1.200 mail.iamghost.com mail The above gives me the correct output when I run the 'hostname' command = 'mail' but when I run the 'hostname -f' command, I get localhost.localdomain. This will cause severe failures in MySQL and Postfix. Not to mention all my certificates I self sign / generate will not have the proper info. Can someone please explain to me why this does not work for me? Normally in distributions like CentOS, Debian, Slackware, etc etc etc...I am able to just enter a hostname and domain name for the system. Thanks!
Carlos Williams wrote:
I have never understood Arch's approach to properly setting a FQDN on a server. According to the Wiki...and I will quote:
"Add your hostname, coinciding with the one specified in /etc/rc.conf, as an alias, so that it looks like this:
127.0.0.1 localhost.localdomain localhost yourhostname
If you use a static IP, add another line using the syntax: <static-IP> <hostname.domainname.org> <hostname> e.g.:
192.168.1.100 yourhostname.domain.org yourhostname"
Now this does not work for me and maybe I am not understanding this but my server hostname is "mail" and it will be managing a domain called "iamghost.com" so I need my output of the command 'hostname -f' to result in 'mail.iamghost.com' and when I follow the guide, that is not what I get.
Obviously my server has a static IP so I followed the Wiki as shown below:
#<ip-address> <hostname.domain.org> <hostname> 127.0.0.1 localhost.localdomain localhost mail 10.1.1.200 mail.iamghost.com mail
The above gives me the correct output when I run the 'hostname' command = 'mail' but when I run the 'hostname -f' command, I get localhost.localdomain. This will cause severe failures in MySQL and Postfix. Not to mention all my certificates I self sign / generate will not have the proper info. Can someone please explain to me why this does not work for me? Normally in distributions like CentOS, Debian, Slackware, etc etc etc...I am able to just enter a hostname and domain name for the system.
Thanks!
Add this 127.0.0.2 mail.iamghost.com mail
On Fri, 22 Jan 2010, Carlos Williams wrote:
I have never understood Arch's approach to properly setting a FQDN on a server. According to the Wiki...and I will quote:
There are no guarantees for the wiki, you should never expect some. There are a lot of "experts" out there today...
The above gives me the correct output when I run the 'hostname' command = 'mail' but when I run the 'hostname -f' command, I get localhost.localdomain.
# Localhost 127.0.0.1 localhost.localdomain localhost # Network 10.1.1.200 mail.iamghost.com mail 10.1.1.201 hostname.iamghost.com hostname www 10.1.1.... -- Adrian C. (anrxc) | anrxc..sysphere.org | PGP ID: D20A0618 PGP FP: 02A5 628A D8EE 2A93 996E 929F D5CB 31B7 D20A 0618
On 01/22/2010 01:51 PM, Carlos Williams wrote:
#<ip-address> <hostname.domain.org> <hostname> 127.0.0.1 localhost.localdomain localhost mail 10.1.1.200 mail.iamghost.com mail
I have seen multiple styles of hosts file, but I tend to set mine up like so: #<ip-address> <hostname.domain.org> <hostname> 127.0.0.1 localhost.localdomain localhost 10.1.1.200 mail.iamghost.com mail This kills two birds with one stone - localhost and localhost -f return the correct info, and it tells the box that "mail" and "mail.iamghost.com" are both at the non-loopback IP you specify. If that's not what you want, then you probably want something more like: #<ip-address> <hostname.domain.org> <hostname> 127.0.0.1 mail.iamghost.com mail localhost.localdomain localhost though, even then, some folks will say that this is also incorrect and you need to designate a loopback per-entry. -Snark
I looks like the best result I get from the following: 127.0.0.1 localhost.localdomain localhost 127.0.0.2 mail.iamghost.com mail 192.168.0.100 " "
participants (4)
-
Adrian C.
-
Baho Utot
-
Carlos Williams
-
Snarkout