I have 2 linux machines, both OpenSUSE 11.0.
In the DNS server (of my wireless modem) they are defined as follows:
NC6000.lan, fixed IP address 10.0.0.152
DC7100.lan, fixed IP address 10.0.0.153
In the Yast → Network Settings → “Hostname/DNS” Tab, these machines are defined as:
Linux-NC6000.home
Linux-DC7100.home
So when I do *ping NC6000 *I see that NC6000.lan has IP address 10.0.0.152
Also ping DC7100, results in *DC7100.lan *with IP address 10.0.0.153. So far nothing wrong.
However, ping Linux-NC6000, results in *Linux-NC6000.home *with IP address 127.0.0.2.
It appears that each machine has two IP address, depending which hostname is used. Not sure if this is the proper network configuration.
My questions: Should I, in Network Settings (Yast), use the same hostname and domain name as in DNS table of my modem?
Yes||no why?
Linux-NC6000 is defined in /etc/hosts. 127.0.0.2 is one of the 2^24-2 possible addresses of the loopback interface, which always exists whether or not you have an Ethernet interface. The use of the loopback interface is for local only services. For example you might want to restrict MySQL to listen only to clients on the same machine and not listen on the Ethernet interface. The loopback address can be used for that.
On Thu, 2009-07-23 at 11:26 +0000, blnl wrote:
> I have 2 linux machines, both OpenSUSE 11.0.
> In the DNS server (of my wireless modem) they are defined as follows:
>
> - NC6000.lan, fixed IP address 10.0.0.152
> - DC7100.lan, fixed IP address 10.0.0.153
>
> In the Yast → Network Settings → “Hostname/DNS” Tab, these machines
> are defined as:
>
> - Linux-NC6000.home
> - Linux-DC7100.home
>
> So when I do -ping NC6000 -I see that -NC6000.lan- has -IP address
> 10.0.0.152-
> Also -ping DC7100-, results in -DC7100.lan -with -IP address
> 10.0.0.153-. So far nothing wrong.
> However, -ping Linux-NC6000-, results in -Linux-NC6000.home -with IP
> -address 127.0.0.2-.
>
> It appears that each machine has two IP address, depending which
> hostname is used. Not sure if this is the proper network configuration.
>
> My questions:
> Should I, in Network Settings (Yast), use the same hostname and domain
> name as in DNS table of my modem?
> Yes||no why?
A long time ago, SUSE took a unique (and valid) approach to dealing with
DHCP and Gnome oddities. SUSE decided that a local address could be
assigned for the hostname (e.g. 127.0.0.2) in DHCP situation to avoid a
long standing Gnome limitation which made certain services (the desktop
itself) not available if the machine failed to get an address for it’s
hostname.
If you don’t believe, go to an older Red Hat box that is DHCP’d,
disconnect the network cable and reboot… no Gnome desktop
Name to IP mapping is not a FIXED thing. I laugh at people who tell me
that their software automatically determines the host’s “IP address”.
Just fyi, if you’re one of them, you’re wrong… make sure you ALWAYS
allow the user to override those values if you’re a sw developer.
I believe you completely and I’m not a sw developer ( no danger from me ).
Still my question is not completely answered.
I would like to change my loopback hostnames to be same as in the DNS server, i.e. replace Linux-NC6000.home with NC6000.lan.
Is that a smart thing to do?
What are the consequences?
On Thu, 2009-07-23 at 17:56 +0000, blnl wrote:
> Thanks guys!
>
> I believe you completely and I’m not a sw developer ( no danger from me
> ).
> Still my question is not completely answered.
>
> I would like to change my loopback hostnames to be same as in the DNS
> server, i.e. replace -Linux-NC6000.home- with -NC6000.lan-.
> Is that a smart thing to do?
> What are the consequences?
Change your hostname in YaST to match what DNS has.
I would like to enter the following values in these fields.
Hostname: NC6000
Domain Name: lan
Currently, in my DNS table NC6000.lan is assigned IP address 10.0.0.152, while Linux-NC6000.home is my loopback network (127.0.0.2).
Will DNS conflict the loopback network when it is renamed to NC6000.lan?
I assume that NC6000.lan cannot have both IP addresses, 127.0.0.2 and 10.0.0.152 at the same time.
Secondly, I’m setting up NFS shares between my two machines, but they don’t see each other. To be precise, I can ping the hostnames but I can’t mount the shared folders. So I thought that it may somehow be related to this hostname confusion.
Eventually, I have found a way to make my hostnames less confusing.
I gave both lookback networks identical hostname linux.home (I assume this is allowed since lookback networks can’t communicate with each other). And on my network each machine gets unique hostname (NC6000.lan, DC7100.lan), which is assigned from the DNS table.