FAQ Search Today's Posts Mark Forums Read
» Video Reviews

» Linux Archive

Linux-archive is a website aiming to archive linux email lists and to make them easily accessible for linux users/developers.


» Sponsor

» Partners

» Sponsor

Go Back   Linux Archive > CentOS > CentOS

 
 
LinkBack Thread Tools
 
Old 02-08-2012, 11:00 PM
Chris
 
Default fqdn hostname fails after reboot

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
_______________________________________________
CentOS mailing list
CentOS@centos.org
http://lists.centos.org/mailman/listinfo/centos
 
Old 02-08-2012, 11:04 PM
Stephen Harris
 
Default fqdn hostname fails after reboot

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.

--

rgds
Stephen
_______________________________________________
CentOS mailing list
CentOS@centos.org
http://lists.centos.org/mailman/listinfo/centos
 
Old 02-08-2012, 11:28 PM
Chris
 
Default fqdn hostname fails after reboot

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
_______________________________________________
CentOS mailing list
CentOS@centos.org
http://lists.centos.org/mailman/listinfo/centos
 
Old 02-09-2012, 10:58 AM
Ljubomir Ljubojevic
 
Default fqdn hostname fails after reboot

On 02/09/2012 01:28 AM, Chris wrote:
> 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?
>

Because someone edited it from Windows, like using WinSCP to access it.


--

Ljubomir Ljubojevic
(Love is in the Air)
PL Computers
Serbia, Europe

Google is the Mother, Google is the Father, and traceroute is your
trusty Spiderman...
StarOS, Mikrotik and CentOS/RHEL/Linux consultant
_______________________________________________
CentOS mailing list
CentOS@centos.org
http://lists.centos.org/mailman/listinfo/centos
 

Thread Tools




All times are GMT. The time now is 07:14 PM.

VBulletin, Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.
Copyright 2007 - 2008, www.linux-archive.org