Page 1 of 2 12 LastLast
Results 1 to 10 of 11

Thread: Hostname

  1. #1
    Moderator
    Good Guru
    Schotty's Avatar
    Join Date
    Jul 2001
    Location
    Milwaukee, WI
    Posts
    5,758

    Hostname

    I have a problem with RedHat 7.2 with setting my hostname properly. As root I run hostname <name of box> it sticks till I reboot. After that it goes back to dhcppc1. Anybody know what I am missing?

  2. #2
    Guest

    Re: Hostname

    I always set mine in /etc/hosts but I use static IP... dunno if that helps !

  3. #3

    Re: Hostname

    look also for a file /etc/HOSTNAME (slackware) , maybe its the same in redhat .. else look at your init scripts it gets set there somewhere.
    And it should work if you put something like : /bin/hostname <name> into /etc/rc.d/rc.local


  4. #4
    Moderator
    Good Guru
    Schotty's Avatar
    Join Date
    Jul 2001
    Location
    Milwaukee, WI
    Posts
    5,758

    Re: Hostname


    look also for a file */etc/HOSTNAME (slackware) *, maybe its the same in redhat .. else look at your init scripts it gets set there somewhere.
    And it should work if you put something like : /bin/hostname <name> into /etc/rc.d/rc.local
    Thanks, but there is no specific file. I was thinking the init scripts are where I ned to fix it, but I figured somebody gaffed the same way I have been. Odd though how slack just happens to work all the time ..... god I miss those days.

    Ill give it a whirl and let y'all know where my goofup was.

    Thanks

  5. #5

    Re: Hostname

    Do you have a network card with a static IP? I've seen lots of systems be listed as "localhost" because that's the only entry in /etc/hosts file. Removing that, or setting it to something different causes problems across many apps, that need a connection to "localhost".

  6. #6
    Moderator
    Good Guru
    Schotty's Avatar
    Join Date
    Jul 2001
    Location
    Milwaukee, WI
    Posts
    5,758

    Re: Hostname

    no its dynamic from my netgear router. Although the lease time is so long that I have never changed ips.

    i didnt get a chance last evening to try editing a few files to see the result. I hopefully will this evening.

  7. #7
    Senior Member
    Join Date
    May 2001
    Posts
    472

    Re: Hostname

    Try grepping your rc.* files for HOSTNAME or hostname - it should find the command that is setting it, so you can "fix" it there.

  8. #8
    Senior Member
    Join Date
    May 2001
    Posts
    411

    Re: Hostname

    Maybe try looking in /etc/rc.d/rc.sysinit and confirm that a line like HOSTNAME='/bin/hostname' exists. Then open /etc/sysconfig/network and see if HOSTNAME is defined. If not, add a line like HOSTNAME=mybox.domain. Also check for NETWORKING=yes and GATEWAY=XXX.XXX.XXX.XXX.

  9. #9
    Moderator
    Good Guru
    Schotty's Avatar
    Join Date
    Jul 2001
    Location
    Milwaukee, WI
    Posts
    5,758

    Re: Hostname

    Thats kinda was my plan, but I have been sick lately. I havent touched my box other that to make sure my genome@home is still running okay. But sometime soon I hope to feel well enough after work to dick with my box.

    Thanks for all the help!! I should have a fix that works between yours and agars suggestions.

  10. #10
    Senior Member
    Join Date
    May 2001
    Posts
    411

    Re: Hostname

    FYI, the config I've shown is from my RH 7.2 box.

Similar Threads

  1. changing hostname with out fouling up network connection?
    By bezdomny in forum Linux - Hardware, Networking & Security
    Replies: 5
    Last Post: 07-23-2008, 12:25 PM
  2. stop dhcp client changing hostname
    By skskal in forum Linux - Hardware, Networking & Security
    Replies: 2
    Last Post: 07-09-2004, 01:14 PM
  3. DHCP and Hostname help
    By mcdougrs in forum Linux - Hardware, Networking & Security
    Replies: 3
    Last Post: 11-07-2002, 09:00 AM
  4. libranet 2.0 says my hostname is invalid (dhcp)
    By capybara in forum Linux - General Topics
    Replies: 2
    Last Post: 03-30-2002, 02:10 PM
  5. changing hostname
    By agar in forum Linux - Hardware, Networking & Security
    Replies: 6
    Last Post: 12-04-2001, 08:31 AM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •