Stuborn Hostname - Mandriva

This is a discussion on Stuborn Hostname - Mandriva ; I don't seem to be able to make my 2008.0 Mandriva machine believe that it's no 'localhost'. My /etc/sysconfig/network file says that it should HOSTNAME=myhost.mydomain.com with the actual names obscured because of spammers. My /etc/hosts file lists this further 192.168.1.13 ...

+ Reply to Thread
Results 1 to 15 of 15

Thread: Stuborn Hostname

  1. Stuborn Hostname

    I don't seem to be able to make my 2008.0 Mandriva machine believe that
    it's no 'localhost'. My /etc/sysconfig/network file says that it should

    HOSTNAME=myhost.mydomain.com

    with the actual names obscured because of spammers. My /etc/hosts file
    lists this further

    192.168.1.13 myhost.mydomain.com
    127.0.0.1 localhost

    But, 'hostname' still reports "localhost" and my command-line prompt
    after a fresh reboot still contains "localhost".

    I've web searched for this some, and it looks like I'm using the right
    files for this.

    If it helps, the machine is a desktop "whitebox" with a wireless network
    card.

    Any ideas folks?

    Thanks....

    --
    PLEASE post a SUMMARY of the answer(s) to your question(s)!
    Unless otherwise noted, the statements herein reflect my personal
    opinions and not those of any organization with which I may be affiliated.

  2. Re: Stuborn Hostname

    On Tuesday 26 August 2008 17:33, someone identifying as *Kevin the Drummer*
    wrote in /alt.os.linux.mandriva:/

    > I don't seem to be able to make my 2008.0 Mandriva machine believe that
    > it's no 'localhost'. My /etc/sysconfig/network file says that it should
    >
    > HOSTNAME=myhost.mydomain.com
    >
    > with the actual names obscured because of spammers. My /etc/hosts file
    > lists this further
    >
    > 192.168.1.13 myhost.mydomain.com
    > 127.0.0.1 localhost


    Change the above so that the line with 127.0.0.1 reads something like...

    127.0.0.1 myhost myhost.mydomain.com localhost

    You will have to issue...

    service network restart

    .... as root for the changes to take effect, or possibly you may need to
    reboot.

    --
    *Aragorn*
    (registered GNU/Linux user #223157)

  3. Re: Stuborn Hostname

    On Tue, 26 Aug 2008 10:33:15 -0500, Kevin the Drummer wrote:

    > I don't seem to be able to make my 2008.0 Mandriva machine believe that
    > it's no 'localhost'. My /etc/sysconfig/network file says that it should
    >
    > HOSTNAME=myhost.mydomain.com
    >
    > with the actual names obscured because of spammers. My /etc/hosts file
    > lists this further
    >
    > 192.168.1.13 myhost.mydomain.com
    > 127.0.0.1 localhost
    >
    > But, 'hostname' still reports "localhost" and my command-line prompt
    > after a fresh reboot still contains "localhost".
    >
    > I've web searched for this some, and it looks like I'm using the right
    > files for this.
    >
    > If it helps, the machine is a desktop "whitebox" with a wireless network
    > card.
    >
    > Any ideas folks?
    >
    > Thanks....


    Exp:
    [wes@wes2 ~]$ hostname
    wes2.com
    [wes@wes2 ~]$ cat /etc/hosts
    127.0.0.1 wes2.com wes2 localhost
    [wes@wes2 ~]$





    --
    Want the ultimate in free OTA SD/HDTV Recorder? http://mythtv.org
    My Tivo Experience http://wesnewell.no-ip.com/tivo.htm
    Tivo HD/S3 compared http://wesnewell.no-ip.com/mythtivo.htm
    AMD cpu help http://wesnewell.no-ip.com/cpu.php

  4. Re: Stuborn Hostname

    On Tue, 26 Aug 2008 10:33:15 -0500, Kevin the Drummer wrote:
    > I don't seem to be able to make my 2008.0 Mandriva machine believe that
    > it's no 'localhost'. My /etc/sysconfig/network file says that it should
    >
    > HOSTNAME=myhost.mydomain.com


    Sure do wish you would copy the following line from this reply, paste in a
    terminal and show us results.

    cat /etc/sysconfig/network ; echo "==="

    I suggest at least 2 additions ( <==== ) for the above file.

    $ cat /etc/sysconfig/network
    NETWORKING_IPV6=no <====
    NOZEROCONF=yes <====
    NEEDHOSTNAME=no
    NETWORKING=yes
    HOSTNAME=wm81.home.test


    Get into the Mandriva Control Center and uncheck On Boot for avahi-daemon

    > with the actual names obscured because of spammers.


    Would it help if they about Joseph Cosgroves in us.

    > My /etc/hosts file
    > lists this further
    >
    > 192.168.1.13 myhost.mydomain.com
    > 127.0.0.1 localhost


    By the way, you might want to add an alias.

    192.168.1.13 myhost.mydomain.com myhost

    and check it and ip addy with
    ping -c1 myhost


    > But, 'hostname' still reports "localhost" and my command-line prompt
    > after a fresh reboot still contains "localhost".
    >
    > I've web searched for this some, and it looks like I'm using the right
    > files for this.


    I will go along with that.

    > If it helps, the machine is a desktop "whitebox" with a wireless network
    > card.


    Could be the lease from there is changing your hostname.
    You might try adding my third line from /etc/sysconfig/network to yours.


    > Any ideas folks?


    I would like to see output from

    ifconfig -a

    Guessing you are not using/running bind/named.

    I hope 65.75.195.30's domain belongs to you. Check it out with the command
    host 65.75.195.30

    Show us results from

    cat /etc/resolv.conf
    cat /etc/host.conf

    grep hosts: /etc/nsswitch.conf

    I do not have a wireless setup,
    or know the wireless commands to look to see what the system is using.

    You might look in something like
    /etc/sysconfig/network-scripts/ifcfg-ath0 <=== guessing name ath0


  5. Re: Stuborn Hostname

    On 2008-08-26, Kevin the Drummer wrote:
    > I don't seem to be able to make my 2008.0 Mandriva machine believe that
    > it's no 'localhost'. My /etc/sysconfig/network file says that it should
    >
    > HOSTNAME=myhost.mydomain.com
    >
    > with the actual names obscured because of spammers. My /etc/hosts file
    > lists this further
    >
    > 192.168.1.13 myhost.mydomain.com
    > 127.0.0.1 localhost
    >
    > But, 'hostname' still reports "localhost" and my command-line prompt
    > after a fresh reboot still contains "localhost".
    >
    > I've web searched for this some, and it looks like I'm using the right
    > files for this.
    >
    > If it helps, the machine is a desktop "whitebox" with a wireless network
    > card.
    >
    > Any ideas folks?
    >
    > Thanks....


    This is ome of the areas in which Mandriva's user-friendliness seems to
    get in the way of those who know 'too much'

    Have you tried using the GUI tools? 'System - Configure your computer'
    from the main menu gets you to the Mandriva Control Centre ("MCC") - or
    run mcc from a command prompt - and under 'Network and Internet' is 'Hosts
    definitions' where you can set or modify the hostnames. I have

    IP Address 127.0.0.1
    Host name tavy.mobile.private
    Host aliases tavy localhost

    there, and I get this in the usual places:

    $ cat /etc/hosts
    127.0.0.1 tavy.mobile.private tavy localhost
    # generated by drakhosts
    $ hostname
    tavy.mobile.private
    $ cat /etc/sysconfig/network
    NETWORKING=yes
    HOSTNAME=tavy.mobile.private

    I get my network IP address by DHCP.

    --
    -- ^^^^^^^^^^
    -- Whiskers
    -- ~~~~~~~~~~

  6. Re: Stuborn Hostname

    On Tue, 26 Aug 2008 20:46:00 +0100, Whiskers wrote:
    >
    > This is ome of the areas in which Mandriva's user-friendliness seems to
    > get in the way of those who know 'too much'
    >
    > there, and I get this in the usual places:
    >
    > $ cat /etc/hosts
    > 127.0.0.1 tavy.mobile.private tavy localhost
    > # generated by drakhosts
    > $ hostname
    > tavy.mobile.private


    Just for fun, run

    hostname --short

    Kinda hurts when you want to use /etc/hosts alias column in a script.

    Of course this might fix that problem.
    127.0.0.1 localhost
    127.0.0.1 tavy.mobile.private tavy


  7. Re: Stuborn Hostname

    On 2008-08-26, Bit Twister wrote:
    > On Tue, 26 Aug 2008 20:46:00 +0100, Whiskers wrote:
    >>
    >> This is ome of the areas in which Mandriva's user-friendliness seems to
    >> get in the way of those who know 'too much'
    >>
    >> there, and I get this in the usual places:
    >>
    >> $ cat /etc/hosts
    >> 127.0.0.1 tavy.mobile.private tavy localhost
    >> # generated by drakhosts
    >> $ hostname
    >> tavy.mobile.private

    >
    > Just for fun, run
    >
    > hostname --short
    >
    > Kinda hurts when you want to use /etc/hosts alias column in a script.
    >
    > Of course this might fix that problem.
    > 127.0.0.1 localhost
    > 127.0.0.1 tavy.mobile.private tavy


    The hosts file generated by drakhosts seems to work just fine here.

    I get

    $ hostname --short
    tavy

    but I don't know what problems that might cause. Perhaps I don't know too
    much for Mandriva?

    I also get

    $ hostname --alias
    tavy localhost


    --
    -- ^^^^^^^^^^
    -- Whiskers
    -- ~~~~~~~~~~

  8. Re: Stuborn Hostname

    On Tue, 26 Aug 2008 21:27:16 +0100, Whiskers wrote:
    > On 2008-08-26, Bit Twister wrote:
    >> On Tue, 26 Aug 2008 20:46:00 +0100, Whiskers wrote:
    >>>
    >>> This is ome of the areas in which Mandriva's user-friendliness seems to
    >>> get in the way of those who know 'too much'
    >>>
    >>> there, and I get this in the usual places:
    >>>
    >>> $ cat /etc/hosts
    >>> 127.0.0.1 tavy.mobile.private tavy localhost
    >>> # generated by drakhosts
    >>> $ hostname
    >>> tavy.mobile.private

    >>
    >> Just for fun, run
    >>
    >> hostname --short
    >>
    >> Kinda hurts when you want to use /etc/hosts alias column in a script.
    >>
    >> Of course this might fix that problem.
    >> 127.0.0.1 localhost
    >> 127.0.0.1 tavy.mobile.private tavy

    >
    > The hosts file generated by drakhosts seems to work just fine here.
    >
    > I get
    >
    > $ hostname --short
    > tavy
    >
    > but I don't know what problems that might cause. Perhaps I don't know too
    > much for Mandriva?
    >
    > I also get
    >
    > $ hostname --alias
    > tavy localhost


    Sorry, that's the command which shows the problem.
    I should have looked in my scripts, where I use --alias.

    I use a different name/ip for each distribution/version I install.
    That gives rise to the problem of my common email accounts, used on each,
    getting/sending email. About two years ago I thought I could get away
    with adding mail for the alias field in hosts for the poor mans's
    named server. :-)

    That's when I found the --alias feature returns everything past column 2. :-(


  9. Re: Stuborn Hostname

    Aragorn wrote:
    > On Tuesday 26 August 2008 17:33, someone identifying as *Kevin the Drummer*
    > wrote in /alt.os.linux.mandriva:/
    >
    > > I don't seem to be able to make my 2008.0 Mandriva machine believe that
    > > it's no 'localhost'. My /etc/sysconfig/network file says that it should
    > >
    > > HOSTNAME=myhost.mydomain.com
    > >
    > > with the actual names obscured because of spammers. My /etc/hosts file
    > > lists this further
    > >
    > > 192.168.1.13 myhost.mydomain.com
    > > 127.0.0.1 localhost

    >
    > Change the above so that the line with 127.0.0.1 reads something like...
    >
    > 127.0.0.1 myhost myhost.mydomain.com localhost



    That's weird. None of the rest of my hosts have ever needed to connect
    127.0.0.1 with any name other than localhost.

    Are you sure about this?


    > You will have to issue...
    > service network restart
    > ... as root for the changes to take effect, or possibly you may need to
    > reboot.


    --
    PLEASE post a SUMMARY of the answer(s) to your question(s)!
    Unless otherwise noted, the statements herein reflect my personal
    opinions and not those of any organization with which I may be affiliated.

  10. Re: Stuborn Hostname

    Whiskers wrote:
    > This is ome of the areas in which Mandriva's user-friendliness seems to
    > get in the way of those who know 'too much'


    Also, .

    > Have you tried using the GUI tools?


    Yes, I actually did that first. Go figure. But, I didn't see any way
    to set the hostname when configuring my wireless interface. I routinely
    see how to set up my hostname on wired interfaces. Hmm, maybe that's
    how I get it to work?

    > 'System - Configure your computer'
    > from the main menu gets you to the Mandriva Control Centre ("MCC") - or
    > run mcc from a command prompt - and under 'Network and Internet' is 'Hosts
    > definitions' where you can set or modify the hostnames. I have
    >
    > IP Address 127.0.0.1
    > Host name tavy.mobile.private
    > Host aliases tavy localhost
    >
    > there, and I get this in the usual places:
    >
    > $ cat /etc/hosts
    > 127.0.0.1 tavy.mobile.private tavy localhost
    > # generated by drakhosts
    > $ hostname
    > tavy.mobile.private
    > $ cat /etc/sysconfig/network
    > NETWORKING=yes
    > HOSTNAME=tavy.mobile.private
    >
    > I get my network IP address by DHCP.


    Is that why so many folks have written back that they assign 127.0.0.1 a
    hostname other than localhost?

    Can't dhclient assign hostnames to DHCP addresses? I've been told that
    it can. But, I don't know how to make that work.

    Thanks again....

    --
    PLEASE post a SUMMARY of the answer(s) to your question(s)!
    Unless otherwise noted, the statements herein reflect my personal
    opinions and not those of any organization with which I may be affiliated.

  11. Re: Stuborn Hostname

    On Tue, 26 Aug 2008 16:49:37 -0500, Kevin the Drummer wrote:

    > Can't dhclient assign hostnames to DHCP addresses? I've been told that
    > it can.


    More like maybe. Going to depend on what the dhcp server will accept.

    > But, I don't know how to make that work.


    A quick read through
    man dhclient
    suggests /etc/dhclient.conf, which should lead you to do a

    man dhclient.conf

    Just keep in mind, depends on what the dhcp server will accept.

  12. Re: Stuborn Hostname

    On 2008-08-26, Bit Twister wrote:
    > On Tue, 26 Aug 2008 21:27:16 +0100, Whiskers wrote:
    >> On 2008-08-26, Bit Twister wrote:
    >>> On Tue, 26 Aug 2008 20:46:00 +0100, Whiskers wrote:
    >>>>
    >>>> This is ome of the areas in which Mandriva's user-friendliness seems to
    >>>> get in the way of those who know 'too much'
    >>>>
    >>>> there, and I get this in the usual places:
    >>>>
    >>>> $ cat /etc/hosts
    >>>> 127.0.0.1 tavy.mobile.private tavy localhost
    >>>> # generated by drakhosts
    >>>> $ hostname
    >>>> tavy.mobile.private
    >>>
    >>> Just for fun, run
    >>>
    >>> hostname --short
    >>>
    >>> Kinda hurts when you want to use /etc/hosts alias column in a script.
    >>>
    >>> Of course this might fix that problem.
    >>> 127.0.0.1 localhost
    >>> 127.0.0.1 tavy.mobile.private tavy

    >>
    >> The hosts file generated by drakhosts seems to work just fine here.
    >>
    >> I get
    >>
    >> $ hostname --short
    >> tavy
    >>
    >> but I don't know what problems that might cause. Perhaps I don't know too
    >> much for Mandriva?
    >>
    >> I also get
    >>
    >> $ hostname --alias
    >> tavy localhost

    >
    > Sorry, that's the command which shows the problem.
    > I should have looked in my scripts, where I use --alias.
    >
    > I use a different name/ip for each distribution/version I install.
    > That gives rise to the problem of my common email accounts, used on each,
    > getting/sending email. About two years ago I thought I could get away
    > with adding mail for the alias field in hosts for the poor mans's
    > named server. :-)
    >
    > That's when I found the --alias feature returns everything past column 2. :-(


    from man hostname:

    OPTIONS
    -a, --alias
    Display the alias name of the host (if used).

    -s, --short
    Display the short host name. This is the host name cut at the
    first dot.

    As long as your alias is the same as the hostname cut at the first dot, it
    would seem that the --short option is the one to use in your script.
    Otherwise, parse the output from --alias to extract the slice you want (I
    know that can be done - but don't ask me to do it, I'd have to do some
    homework!)

    As 'localhost' is a valid, indeed essential, alias for any system, I don't
    think it's wrong for that to be included in the output of the --alias
    option.

    I don't understand what that has to do with email - but I just use a
    seperate email program on each system, set to leave messages on the POP
    server until several days after they've been 'read' by the program I use
    on my main system.

    --
    -- ^^^^^^^^^^
    -- Whiskers
    -- ~~~~~~~~~~

  13. Re: Stuborn Hostname

    On Tuesday 26 August 2008 23:33, someone identifying as *Kevin the Drummer*
    wrote in /alt.os.linux.mandriva:/

    > Aragorn wrote:
    >> On Tuesday 26 August 2008 17:33, someone identifying as *Kevin the
    >> Drummer* wrote in /alt.os.linux.mandriva:/
    >>
    >> > I don't seem to be able to make my 2008.0 Mandriva machine believe that
    >> > it's no 'localhost'. My /etc/sysconfig/network file says that it
    >> > should
    >> >
    >> > HOSTNAME=myhost.mydomain.com
    >> >
    >> > with the actual names obscured because of spammers. My /etc/hosts file
    >> > lists this further
    >> >
    >> > 192.168.1.13 myhost.mydomain.com
    >> > 127.0.0.1 localhost

    >>
    >> Change the above so that the line with 127.0.0.1 reads something like...
    >>
    >> 127.0.0.1 myhost myhost.mydomain.com localhost

    >
    >
    > That's weird. None of the rest of my hosts have ever needed to connect
    > 127.0.0.1 with any name other than localhost.


    Well, you obviously have a command prompt that says that your hostname
    is /localhost,/ so apparently your hostname gets set before your network
    set-up can equate the other private range IP address to your machine, and
    with it the hostname defined for that IP address.

    > Are you sure about this?


    Not really, as a lot seems to depend on Mandriva-specific scripts for
    setting up the networks, but I do see other posters - e.g. Bit Twister -
    doing it that way, and I found that it was set up that way on my computer
    here as well back when I installed the distro on it.

    So perhaps this is the proper way to do it... ;-)

    --
    *Aragorn*
    (registered GNU/Linux user #223157)

  14. Re: Stuborn Hostname

    On Tue, 26 Aug 2008 23:03:44 +0100, Whiskers wrote:
    > from man hostname:
    >
    > OPTIONS
    > -a, --alias
    > Display the alias name of the host (if used).
    >
    > -s, --short
    > Display the short host name. This is the host name cut at the
    > first dot.
    >
    > As long as your alias is the same as the hostname cut at the first dot, it
    > would seem that the --short option is the one to use in your script.


    Yes, but I had stopped reading at --alias.
    and not too long later I had
    $ grep -- --alias * | wc -l
    20

    Could run those through sed.

    I just wanted to point out what happens using multiple aliases in /etc/hosts.


    > I don't understand what that has to do with email - but I just use a
    > seperate email program on each system, set to leave messages on the POP
    > server until several days after they've been 'read' by the program I use
    > on my main system.


    I just wanted to put mail as the hostname in the mail clients.
    That way, different host names would not matter.
    Other machine would know where to forward mail.

    Running named solved the problem.


  15. Re: Stuborn Hostname

    On 2008-08-26, Kevin the Drummer wrote:
    > Aragorn wrote:
    >> On Tuesday 26 August 2008 17:33, someone identifying as *Kevin the Drummer*
    >> wrote in /alt.os.linux.mandriva:/
    >>
    >> > I don't seem to be able to make my 2008.0 Mandriva machine believe that
    >> > it's no 'localhost'. My /etc/sysconfig/network file says that it should
    >> >
    >> > HOSTNAME=myhost.mydomain.com
    >> >
    >> > with the actual names obscured because of spammers. My /etc/hosts file
    >> > lists this further
    >> >
    >> > 192.168.1.13 myhost.mydomain.com
    >> > 127.0.0.1 localhost

    >>
    >> Change the above so that the line with 127.0.0.1 reads something like...
    >>
    >> 127.0.0.1 myhost myhost.mydomain.com localhost

    >
    >
    > That's weird. None of the rest of my hosts have ever needed to connect
    > 127.0.0.1 with any name other than localhost.
    >
    > Are you sure about this?
    >
    >
    >> You will have to issue...
    >> service network restart
    >> ... as root for the changes to take effect, or possibly you may need to
    >> reboot.


    The traditional way to set up a hosts file is to use the
    first form:

    >> > 192.168.1.13 myhost.mydomain.com
    >> > 127.0.0.1 localhost


    Several years ago, I think while I was still using HatRed,
    before switching to Mandr*, printed documentation specified
    the above form.

    --
    Robert Riches
    spamtrap42@verizon.net
    (Yes, that is one of my email addresses.)

+ Reply to Thread