Re: localhost hostname problem

From: Nifty Hat Mitch (mitch48_at_sbcglobal.net)
Date: 07/03/04

  • Next message: Greg Swallow: "Re: New nVidia vs FC2 and rivafb (CON'T)"
    Date: Fri, 2 Jul 2004 18:20:03 -0700
    To: For users of Fedora Core releases <fedora-list@redhat.com>
    
    

    On Sat, Jun 26, 2004 at 09:46:17PM -0600, Eric Diamond wrote:
    > >From James Lawrence's reply to paul@sark.us on Saturday, June 26, 2004
    > 6:07 PM:
    > >
    > > Paul wrote:
    > >
    > > >I'm having a devil of a time: running FC2 through eth0 RCA modem on
    > > >comcast.net. That connection did something, now instead of being
    > > >localhost at login, I'm x1-6-04-4f-00 or something like that, which
    > > >happens to be the hw addy of the eth0. How do I change this, or at
    > > >least nickname it, to get back to localhost? I'm a newbie
    > > wanting to
    > > >learn! :) Thanks.
    >
    > localhost@localdomain is not really a valid hostname in a networked
    > environment. Comcast has strict internal guidelines requiring unique
    > hostnames thoughout their network. They have set up their DHCP servers
    > to force a unique hostname whenever they find a machine without one
    > (either no name at all or one that is currently in use). I'm not sure
    > which category they group localhost in, but since customers are not
    > allowed to use it the distinction is mute.

    Erik is correct. note the '@' sign should be a dot.

    The key thing here is that each network connection has a name
    and that the system inherits a name almost as a side effect.

    The first interesting line in /etc/hosts looks like:

        127.0.0.1 localhost.localdomain localhost

    This line names the special case, local loopback interface (lo0).
    i.e. lo0 is an interface:

    One common edit of this line might look like.

        127.0.0.1 localhost.localdomain localhost box1.paul.localdomain box1

    And now the system admin can use an alias "box1.paul.localdomain" or
    "box1" for the system. This may confuse things later but, the alias
    maps back to the 127.0.0.1 address and the localhost.localdomain name.
    In the file "/etc/sysconfig/network" you might do this with a line
    that looks like:
       
       HOSTNAME=box1.paul.localdomain

      or perhaps

       HOSTNAME=box1

    When the system boots it picks up the host name and matches it
    to a line in the hosts file (/etc/hosts;. See /etc/sysconfig/network
    and eventually all these other files too:

        /etc/sysconfig/network/networking/*
        /etc/sysconfig/network/network-scripts/*

    There may be hard links to /etc/hosts that should not be broken.
    While exceptions apply,
    Some of us will see:

        /etc/sysconfig/networking/profiles/default/hosts

    Note the same inode number:

       # ls -il /etc/sysconfig/networking/profiles/default/hosts /etc/hosts
       6734009 -rw-r--r-- 2 root root 2619 Jun 16 07:30 /etc/hosts
       6734009 -rw-r--r-- 2 root root 2619 Jun 16 07:30 /etc/sysconfig/networking/profiles/default/hosts

    Timing is important. Names and numbers for the important interfaces
    mostly need to be in /etc/hosts to bootstrap the process. X-server
    connections will be made to 127.0.0.1 so this must exist and be
    correct. Once connected to the internet the domain name service DNS
    can look up additional host name and IP address pairs as needed.
    Some of this can be discovered with a broadcast help packet
    which is how DHCP works.

    Next when you connect to Comcast, for your ethernet link, as the
    connection process begins you first get an additional interface
    activated (commonly eth0). Next a dynamic host name process (DHCP)
    fetches an IP address and the public name for this interface. It names
    it and brings it up. Other network hints for DNS and routing are
    shared via this DHCP process. If you did not name localhost via the
    HOSTNAME variable you correctly can expect to get a host name that
    looks like x1-6-04-4f-00 or something at this stage.

    Now you have two named interfaces. One name you appear to have
    control of on lo0 and the other is assigned to you by your ISP
    dynamically each time you connect on eth0.

    If you attempt to lookup the IP address associated with
    box1.paul.localdomain you should get 127.0.0.1. If anyone else
    attempts to look it up they will not get a good answer. This is what I
    mean that you appear to have control of the host name.

    The x1-6-04-4f-00 or something name should work for both internal and
    external connections. It is this :x1-6-04-4f-00 or something" named
    interface that your 'services' will use to connect to and from the
    world. The nature of DHCP is that this will change so you do not need
    to write it down. You should not expect it to be a constant!

    The HOSTNAME= line is important because it decides which name to use
    for system services even if there are twohundredfortyfive named
    network interfaces (chill, Linux does not support that many by default).

    The key point is that you will commonly have two active network
    connections: localhost.localdomain on lo0 and another on eth0,
    genericname.yourisp.toplevel. Again it is the interfaces that have
    names.

    The devices lo0 and eth0 are only two of a long list of names for
    devices that map to a kernel device driver. On FC1 see /etc/modules.conf:

            alias eth0 via-rhine

    In FC2 see /etc/modprobe.conf:

            alias eth0 via-rhine

    If your hardware is different you will see different driver names.
    If you have multiple network cards you can see multiple lines
    sort of like this:
       $ grep eth /etc/mod*
       /etc/modules.conf:alias eth0 via-rhine
       /etc/modules.conf:alias eth1 tulip

    Again,
       The key thing to recall is that network connections have names.

    <end part A, Lesson 1, chapter 1>

    -- 
    	T o m  M i t c h e l l 
    	/dev/null the ultimate in secure storage.
    -- 
    fedora-list mailing list
    fedora-list@redhat.com
    To unsubscribe: http://www.redhat.com/mailman/listinfo/fedora-list
    

  • Next message: Greg Swallow: "Re: New nVidia vs FC2 and rivafb (CON'T)"

    Relevant Pages

    • Cant access the Internet from behind a 192.168.1.x net using natd
      ... packets go across the external interface. ... Here's one set of firewall rules I tried: ... # Simple stateful network firewall rules for IPFW with NAT v. 1.01 ... # End of required user input if you only intend to allow ssh connections to ...
      (FreeBSD-Security)
    • Re: telnet does not know my hostname name
      ... within the range of IPs that you're using? ... hostname comes up with someone else's IP, ... >> interface that's relevant to the task, not trying to make the loopback ... If you get your network addressing out of whack, ...
      (linux.redhat.install)
    • RE: NetScreen ScreenOS 2.6 Subject to Trust Interface DoS
      ... trusted network interface is partially assumed secure. ... in a log that maximum # of connections is reached and it will not allow ... connection to management interface until there will be available connection. ... NetScreen ScreenOS 2.6 Subject to Trust Interface DoS ...
      (Bugtraq)
    • Re: Any posted issues with Tablet PC and ActiveSync 4.1?
      ... No the interface for the Pocket PC is fine with the default addresses. ... from which I obtain ip addresses via dhcp is a 10.0.10.X network, ... check to make sure it is allowing multiple network connections. ... setting got unchecked somehow in ActiveSync in the device. ...
      (microsoft.public.pocketpc.activesync)
    • Re: [SLE] No hostname, domainname, /etc/resolv.conf, or default route after WiFi connection
      ... >>After a wireless internet session using DHCP, my 9.3 Pro system is left ... it should restore the default hostname etc. ... name, perhaps connected to my home network, perhaps not. ... invoke network connections manually, I'm not connected yet to my home ...
      (SuSE)