Hi,
I have several machines running CentOS 6.2 and a strange problem with the hostname of one machine... After every reboot it loses the fqdn hostname.
Here is my confguration:
ifconfig | grep "inet addr" inet addr:10.0.0.12 Bcast:10.0.0.255 Mask:255.255.255.0 inet addr:127.0.0.1 Mask:255.0.0.0
/etc/sysconfig/network
NETWORKING=yes HOSTNAME=x800.mydomain.local GATEWAY=10.0.0.1
127.0.0.1 localhost localhost.localdomain localhost4 localhost4.localdomain4 ::1 localhost localhost.localdomain localhost6 localhost6.localdomain6 10.0.0.12 x800.mydomain.local x800
... after a reboot:
hostname x800.mydomain.local < OK
hostname -f hostname: Unknown host < NOT OK
dnsdomainname dnsdomainname: Unknown host < NOT OK
If I set the hostname manually:
hostname x800.mydomain.local
hostname -f x800.mydomain.local < OK
dnsdomainname mydomain.local < OK
Everything is okay ...
Something I've never experienced before. Does anyone have an idea?
thx
-- Chris
On Feb 8, 2012, at 4:22 PM, Chris wrote:
Hi,
I have several machines running CentOS 6.2 and a strange problem with the hostname of one machine... After every reboot it loses the fqdn hostname.
Here is my confguration:
ifconfig | grep "inet addr" inet addr:10.0.0.12 Bcast:10.0.0.255 Mask:255.255.255.0 inet addr:127.0.0.1 Mask:255.0.0.0
/etc/sysconfig/network
NETWORKING=yes HOSTNAME=x800.mydomain.local GATEWAY=10.0.0.1
127.0.0.1 localhost localhost.localdomain localhost4 localhost4.localdomain4 ::1 localhost localhost.localdomain localhost6 localhost6.localdomain6 10.0.0.12 x800.mydomain.local x800
... after a reboot:
hostname x800.mydomain.local < OK
hostname -f hostname: Unknown host < NOT OK
dnsdomainname dnsdomainname: Unknown host < NOT OK
If I set the hostname manually:
hostname x800.mydomain.local
hostname -f x800.mydomain.local < OK
dnsdomainname mydomain.local < OK
Everything is okay ...
Something I've never experienced before. Does anyone have an idea?
thx
-- Chris
When I strace hostname -f I see it checking with my name server. Are your 2 systems set up differently with respect to name resolution and/or DNS?
Tony
2012/2/8 Tony Schreiner anthony.schreiner@bc.edu:
On Feb 8, 2012, at 4:22 PM, Chris wrote:
Hi,
I have several machines running CentOS 6.2 and a strange problem with the hostname of one machine... After every reboot it loses the fqdn hostname.
Here is my confguration:
ifconfig | grep "inet addr" inet addr:10.0.0.12 Bcast:10.0.0.255 Mask:255.255.255.0 inet addr:127.0.0.1 Mask:255.0.0.0
/etc/sysconfig/network
NETWORKING=yes HOSTNAME=x800.mydomain.local GATEWAY=10.0.0.1
127.0.0.1 localhost localhost.localdomain localhost4 localhost4.localdomain4 ::1 localhost localhost.localdomain localhost6 localhost6.localdomain6 10.0.0.12 x800.mydomain.local x800
... after a reboot:
hostname x800.mydomain.local < OK
hostname -f hostname: Unknown host < NOT OK
dnsdomainname dnsdomainname: Unknown host < NOT OK
If I set the hostname manually:
hostname x800.mydomain.local
hostname -f x800.mydomain.local < OK
dnsdomainname mydomain.local < OK
Everything is okay ...
Something I've never experienced before. Does anyone have an idea?
thx
-- Chris
When I strace hostname -f I see it checking with my name server. Are your 2 systems set up differently with respect to name resolution and/or DNS?
I have 5 systems with the same DNS configuration. (name servers in /etc/resolv.conf)
It seems that /etc/hosts is ignored.. on this system only. But I do not know why :(
-- Chris
On Wed, Feb 8, 2012 at 5:52 PM, Chris xchris89x@googlemail.com wrote:
2012/2/8 Tony Schreiner anthony.schreiner@bc.edu:
On Feb 8, 2012, at 4:22 PM, Chris wrote:
Hi,
I have several machines running CentOS 6.2 and a strange problem with the hostname of one machine... After every reboot it loses the fqdn hostname.
Here is my confguration:
ifconfig | grep "inet addr" inet addr:10.0.0.12 Bcast:10.0.0.255 Mask:255.255.255.0 inet addr:127.0.0.1 Mask:255.0.0.0
/etc/sysconfig/network
NETWORKING=yes HOSTNAME=x800.mydomain.local GATEWAY=10.0.0.1
127.0.0.1 localhost localhost.localdomain localhost4
localhost4.localdomain4
::1 localhost localhost.localdomain localhost6
localhost6.localdomain6
10.0.0.12 x800.mydomain.local x800
... after a reboot:
hostname x800.mydomain.local < OK
hostname -f hostname: Unknown host < NOT OK
dnsdomainname dnsdomainname: Unknown host < NOT OK
If I set the hostname manually:
hostname x800.mydomain.local
hostname -f x800.mydomain.local < OK
dnsdomainname mydomain.local < OK
Everything is okay ...
Something I've never experienced before. Does anyone have an idea?
thx
-- Chris
When I strace hostname -f I see it checking with my name server. Are your 2 systems set up differently with respect to name resolution
and/or DNS?
I have 5 systems with the same DNS configuration. (name servers in /etc/resolv.conf)
It seems that /etc/hosts is ignored.. on this system only. But I do not know why :(
-- Chris _______________________________________________ CentOS mailing list CentOS@centos.org http://lists.centos.org/mailman/listinfo/centos
Chris,
verify the config in your /etc/nsswitch.conf
2012/2/8 Earl Ramirez earlaramirez@gmail.com:
On Wed, Feb 8, 2012 at 5:52 PM, Chris xchris89x@googlemail.com wrote:
2012/2/8 Tony Schreiner anthony.schreiner@bc.edu:
On Feb 8, 2012, at 4:22 PM, Chris wrote:
Hi,
I have several machines running CentOS 6.2 and a strange problem with the hostname of one machine... After every reboot it loses the fqdn hostname.
Here is my confguration:
ifconfig | grep "inet addr" inet addr:10.0.0.12 Bcast:10.0.0.255 Mask:255.255.255.0 inet addr:127.0.0.1 Mask:255.0.0.0
/etc/sysconfig/network
NETWORKING=yes HOSTNAME=x800.mydomain.local GATEWAY=10.0.0.1
127.0.0.1 localhost localhost.localdomain localhost4
localhost4.localdomain4
::1 localhost localhost.localdomain localhost6
localhost6.localdomain6
10.0.0.12 x800.mydomain.local x800
... after a reboot:
hostname x800.mydomain.local < OK
hostname -f hostname: Unknown host < NOT OK
dnsdomainname dnsdomainname: Unknown host < NOT OK
If I set the hostname manually:
hostname x800.mydomain.local
hostname -f x800.mydomain.local < OK
dnsdomainname mydomain.local < OK
Everything is okay ...
Something I've never experienced before. Does anyone have an idea?
thx
-- Chris
When I strace hostname -f I see it checking with my name server. Are your 2 systems set up differently with respect to name resolution
and/or DNS?
I have 5 systems with the same DNS configuration. (name servers in /etc/resolv.conf)
It seems that /etc/hosts is ignored.. on this system only. But I do not know why :(
-- Chris _______________________________________________ CentOS mailing list CentOS@centos.org http://lists.centos.org/mailman/listinfo/centos
Chris,
verify the config in your /etc/nsswitch.conf
Yes, default config. Without any changes...
-- Chris
Chris wrote:
2012/2/8 Tony Schreiner anthony.schreiner@bc.edu:
On Feb 8, 2012, at 4:22 PM, Chris wrote:
I have several machines running CentOS 6.2 and a strange problem with the hostname of one machine... After every reboot it loses the fqdn hostname.
<snip>
Everything is okay ...
Something I've never experienced before. Does anyone have an idea?
<snip>
I have 5 systems with the same DNS configuration. (name servers in /etc/resolv.conf)
It seems that /etc/hosts is ignored.. on this system only. But I do not know why :(
AH! A light may be dawning. What's the hosts line in /etc/nsswitch.conf?
mark
2012/2/8 Chris xchris89x@googlemail.com:
Hi,
I have several machines running CentOS 6.2 and a strange problem with the hostname of one machine... After every reboot it loses the fqdn hostname.
Here is my confguration:
ifconfig | grep "inet addr" inet addr:10.0.0.12 Bcast:10.0.0.255 Mask:255.255.255.0 inet addr:127.0.0.1 Mask:255.0.0.0
/etc/sysconfig/network
NETWORKING=yes HOSTNAME=x800.mydomain.local GATEWAY=10.0.0.1
127.0.0.1 localhost localhost.localdomain localhost4 localhost4.localdomain4 ::1 localhost localhost.localdomain localhost6 localhost6.localdomain6 10.0.0.12 x800.mydomain.local x800
... after a reboot:
hostname x800.mydomain.local < OK
hostname -f hostname: Unknown host < NOT OK
dnsdomainname dnsdomainname: Unknown host < NOT OK
If I set the hostname manually:
hostname x800.mydomain.local
hostname -f x800.mydomain.local < OK
dnsdomainname mydomain.local < OK
Everything is okay ...
Something I've never experienced before. Does anyone have an idea?
thx
-- Chris
Another thing about this, postfix fails on startup:
Feb 9 00:49:57 x800 postfix[1387]: warning: valid_hostname: invalid character 13(decimal): x800.mydomain.local? Feb 9 00:49:57 x800 postfix[1387]: fatal: unable to use my own hostname Feb 9 00:49:59 x800 postfix/sendmail[1471]: warning: valid_hostname: invalid character 13(decimal): x800.mydomain.local? Feb 9 00:49:59 x800 postfix/sendmail[1471]: fatal: unable to use my own hostname
Because some CentOS system file is corrupted?
After setting "hostname x800.mydomain.local" postfix starts normally.
-- Chris
On Thu, Feb 09, 2012 at 01:00:33AM +0100, Chris wrote:
Feb 9 00:49:57 x800 postfix[1387]: warning: valid_hostname: invalid character 13(decimal): x800.mydomain.local?
13 is control-M.
One of your config files is in DOS format and has an embedded control-M in it. Check /etc/sysconfig/network. If you "vi" it, does it show ^M at the end, or does the bottom line say [dos] ?
When you find the file, "dos2unix" will fix it.
2012/2/9 Stephen Harris lists@spuddy.org:
On Thu, Feb 09, 2012 at 01:00:33AM +0100, Chris wrote:
Feb 9 00:49:57 x800 postfix[1387]: warning: valid_hostname: invalid character 13(decimal): x800.mydomain.local?
13 is control-M.
One of your config files is in DOS format and has an embedded control-M in it. Check /etc/sysconfig/network. If you "vi" it, does it show ^M at the end, or does the bottom line say [dos] ?
When you find the file, "dos2unix" will fix it.
Thank you very very much !!
After converting... [root@x800 sysconfig]# dos2unix network dos2unix: converting file network to UNIX format ...
Everything works fine :)
But I do not understand why it was in DOS format?
-- Chris
On 02/09/2012 01:28 AM, Chris wrote:
2012/2/9 Stephen Harrislists@spuddy.org:
On Thu, Feb 09, 2012 at 01:00:33AM +0100, Chris wrote:
Feb 9 00:49:57 x800 postfix[1387]: warning: valid_hostname: invalid character 13(decimal): x800.mydomain.local?
13 is control-M.
One of your config files is in DOS format and has an embedded control-M in it. Check /etc/sysconfig/network. If you "vi" it, does it show ^M at the end, or does the bottom line say [dos] ?
When you find the file, "dos2unix" will fix it.
Thank you very very much !!
After converting... [root@x800 sysconfig]# dos2unix network dos2unix: converting file network to UNIX format ...
Everything works fine :)
But I do not understand why it was in DOS format?
Because someone edited it from Windows, like using WinSCP to access it.