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

Thread: Hostname

Hybrid View

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

    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,760

    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,760

    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,760

    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. hostname to IP
    By datamike in forum Linux - General Topics
    Replies: 9
    Last Post: 02-15-2013, 12:21 PM
  2. Hostname idea
    By mcdougrs in forum Linux - Hardware, Networking & Security
    Replies: 5
    Last Post: 12-15-2002, 08:41 PM
  3. DHCP and Hostname help
    By mcdougrs in forum Linux - Hardware, Networking & Security
    Replies: 3
    Last Post: 11-07-2002, 10:00 AM
  4. hostname of a pc
    By kemu in forum Linux - Hardware, Networking & Security
    Replies: 3
    Last Post: 10-02-2002, 11:56 PM
  5. hostname in iptables?
    By tolstoy in forum Linux - Software, Applications & Programming
    Replies: 0
    Last Post: 01-17-2002, 10:02 PM

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
  •