Results 1 to 8 of 8

Thread: hosts file

Hybrid View

  1. #1

    hosts file

    Red Hat 6.2.
    Here is the hosts file
    127.0.0.1 wsense localhost.localdomain localhost
    I need this workstation to be a part of internal bel.com domain.Ip address of that machine is 10.0.20.3.
    How should I change my hosts file.

  2. #2

    Re: hosts file

    Edit /etc/sysconfig/network. You should see an entry for your hostname that will most likely say localhost.localdomain. Just change that. Make sure your LAN DNS is updated so other hosts can resolve to this box by the new name.

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

    Re: hosts file


    Red Hat 6.2.
    Here is the hosts file
    127.0.0.1 * * * * * * * wsense localhost.localdomain localhost
    I need this workstation to be a part of internal bel.com domain.Ip address of that machine is 10.0.20.3.
    How should I change my hosts file.
    Well to add more hosts to your little DNS file (useful for pinging sparebox.you.net instead of ping 1.2.3.4) just edit /etc/hosts

    and add a line for each PC that is on your LAN in the following fashion.

    IP {tab} hostnames
    IP {tab} hsotnames

    Add one for each PC in you LAN. Restart your PC ( I may be wrong but bringing down you network stack is necessary to reload that stuff, and can only be accompished by going to runlevel 0/1 to runlevel3/5)

    You should once you get back up, be able to ping your boxes by going ping name.of.your.box.

    Any Q's feeel free to ask !

  4. #4

    Re: hosts file



    Well to add more hosts to your little DNS file (useful for pinging sparebox.you.net instead of ping 1.2.3.4) just edit /etc/hosts

    and add a line for each PC that is on your LAN in the following fashion.

    IP {tab} hostnames
    IP {tab} hsotnames
    If this box is on a LAN running a full DNS implementation, I wouldn't even bother with /etc/hosts, other than to add your own hostname to the lookback (127.0.0.1) line. Upkeeping a hosts file is just too much work if you have a nameserver already running.

  5. #5

    Re: hosts file

    Still not clear about a couple of things:
    This is my sysconfig/network file:
    NETWORKING=yes
    HOSTNAME=wsense
    GATEWAY=10.0.82.3

    Should I change wsense to wsense.bel.com? Will it be somehow reflected in hosts file (automatically)? Or should I change hosts file as well?

    All I want to do is to join this box to existing domain, (You know, like on windoxe box going to tcp/ip properties and specifying domain name...)

  6. #6

    Re: hosts file

    Still not clear about a couple of things:
    This is my sysconfig/network file:
    NETWORKING=yes
    HOSTNAME=wsense
    GATEWAY=10.0.82.3

    Should I change wsense to wsense.bel.com? Will it be somehow reflected in hosts file (automatically)? Or should I change hosts file as well?

    All I want to do is to join this box to existing domain, (You know, like on windoxe box going to tcp/ip properties and specifying domain name...)
    1) Put your FQDN in your /etc/sysconfig/networks, meaning wsense.bel.com. I don't know if you need the whole FQDN or just the host name, but putting the whole thing in there won't hurt. This file tells your box what its name is.
    2) /etc/hosts is just a fail over, or replacement for DNS. Actually it's really the great grandfather of DNS. If you are on a domain, you will only need the hostname in the loopback portion (127.0.0.1).
    3) Add the appropriate A and PTR records on your name server for this host.

    That should be it, unless of course you want to be able to browse WIndoze boxes with this box, or allow it to browze the NT domain. For that you will need samba.

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

    Re: hosts file




    If this box is on a LAN running a full DNS implementation, I wouldn't even bother with /etc/hosts, other than to add your own hostname to the lookback (127.0.0.1) line. Upkeeping a hosts file is just too much work if you have a nameserver already running.
    I would tend to agree if there were more than a handful. NIS does that much better, and can be much more quickly implemented on a larger scale. But for small LAN's, it isnt that difficult anyhow. Plus it makes life that much easier. Typing 123.123.123.123 each time BOB needs to be accessed can be time consuming.

    As for changing HIS hostname (I missed that apparently), your file in questin for RedHat and SuSE is /etc/network . Mine looks like this

    Code:
    NETWORKING=yes
    HOSTNAME=wildturkey.schotty.net
    GATEWAY=1.1.0.1
    That is all you really need to get going with a new hostname. IIRC, on some distros the command hostname will work too. Slackware IIRC does it that way.


  8. #8

    Re: hosts file

    thanks

Similar Threads

  1. help for etc/hosts
    By bongkietwins in forum Redhat / Fedora
    Replies: 3
    Last Post: 10-07-2007, 04:05 AM
  2. updatation of hosts file in windows xp
    By mikdadhussain in forum Linux - Hardware, Networking & Security
    Replies: 0
    Last Post: 06-01-2007, 07:53 AM
  3. HOSTS File
    By Lord_Anubis in forum Windows - General Topics
    Replies: 1
    Last Post: 01-14-2007, 03:38 AM
  4. squid doesn't read local hosts file, why?
    By soulhealer in forum Linux - General Topics
    Replies: 3
    Last Post: 03-30-2006, 06:57 AM
  5. How to allow only specific hosts to log on via SSH
    By Compunuts in forum Linux - Hardware, Networking & Security
    Replies: 4
    Last Post: 08-25-2003, 07:35 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
  •