confused by hostnames

MPICH and OPENMPI seem to have trouble nowadays and I’m not sure why. Here is a typical error:

patti@OS121-TY3:~/bor> /opt/mpich/ch-p4/bin/mpirun -np 4 pll.exe
p0_44650: p4_error: Could not gethostbyname for host OS121-TY3; may be invalid name
: 64
patti@OS121-TY3:~/bor> hostname
OS121-TY3
patti@OS121-TY3:~/bor>

…but in the body of my /etc/HOSTNAME file = OS121-TY3.MY-WORKGROUP

…so is the trouble with that dot extension? How can mpirun have trouble finding my hostname? I get a similar “Could not gethostbyname for host OS121-TY3” error with Openmpi’s mpirun command. I have a single multiprocessor workstation - running Opensuse 12.2 x64

Thank you for any help!
Patricia

The gethostbyname() function is looking in DNS and in “/etc/hosts”. It is not looking in “/etc/HOSTNAME”.

Thanks for the reply - I had not seen this problem before and thought it might have something to do with that dot-extension to the host name since that seems also fairly new (after opensuse 11.x, I think). I had looked in the YaST applet for hosts and didn’t see my hostname there (although other things, like 127.0.0.1 and localhost, were there). I just now checked /etc/hosts and did not see my hostname there. Should I add it manually? I’m not sure how it would be picking up that host name since it’s not in /etc/hosts - maybe from HOSTNAME? - maybe the DNS picked up the host name and it’s getting it from the DNS? (I have a router.)

I’m stumbling over how this got broke. In the past, openmpi and mpich1.2 were pretty straightforward to use - I didn’t have to mess around with host files since this is just a multiprocessor workstation. I think this was a vanilla 12.2 setup, but it may have been an online update from 12.1 and maybe things got broken during the update. - Patti

When I set a hostname with Yast, I check the box “Assign hostname to loopback IP”. That puts an entry in “/etc/hosts”. But whether that’s the right entry for your needs, I cannot tell.

More recently, some folk have been saying that checking that box causes problems for “postfix”. I don’t use “postfix” so I haven’t noticed that.

Thank you very much, I didn’t see that checkbox or else didn’t understand what it was meant to do. I will give that a try.

Patti
EDIT: There doesn’t seem to be such a checkbox in the Yast “Hostnames” applet. Maybe you were referring to another applet? What’s odd is that Openmpi is supposed to be “smart” enough to recognize that all procs are on a localhost and not bother with the IP stack for interproc communication. :-/

On 2013-12-21 02:56, PattiMichelle wrote:

> …but in the body of my /etc/HOSTNAME file = OS121-TY3.MY-WORKGROUP
>
> …so is the trouble with that dot extension?

Well, anything after the dot is part of the domain, not the hostname. You can set them both in Yast
network config, “Hostname/DNS” tab. In the same tab you can click on “Assign Hostname to Loopback
IP” tick.

I don’t think you can have a hostname with a dot in it.


Cheers / Saludos,

Carlos E. R.
(from 13.1 x86_64 “Bottle” (Elessar))

Hi: What’s the name of the Yast applet you’re talking about? I tried Hostnames and Network Services and there aren’t any tabs.

It’s “Network Settings”.

On 2013-12-21 18:26, PattiMichelle wrote:

> Hi: What’s the name of the Yast applet you’re talking about? I tried
> Hostnames and Network Services and there aren’t any tabs.

Yast, Network devices on the left hand panel, Network settings on the right hand panel, click.


Cheers / Saludos,

Carlos E. R.
(from 13.1 x86_64 “Bottle” (Elessar))

Heh - OIC - Network Devices, not Network Services… :shame: Also, I’ve been using Network Manager - time to switch back to ifup. After doing so, it added 127.0.0.2 (a “loopback?”) to /etc/hosts for my hostname (both full and short) - so we will see if this helps.

Thank You :slight_smile:

Also, is there a good reason not to disable IPv6 in simple opensuse systems? I noticed sysadmins doing this in Windows - adds unnecessary complexity?

You can still use that screen to set hostname, without having to switch back to “ifup”. It works just as well with “NetworkManager”.

Although a Hostname cannot have a dot in it (the dot is a delimiter), there ordinarily is nothing to prevent a Hostname entry to include a dot.

So, for instance it’s perfectly legal and functional to create an entry in the /etc/hosts file which has more than one dot in the entry.
But since the dot is a delimiter, technically the entry actually describes at least one subdomain (besides the hostname and optional domain).
Or, there might not be <any> dot, eg the localhost entry. That only means the hostname isn’t “fully qualified” – A FQDN requires a hostname plus a domain name separated by a dot.

So, bottom line is that entries in the /etc/hosts file do not require a dot and might contain any number of dots.
But, the Hostname itself can’t contain a dot.

Confusing enough?
TSU

On 2013-12-22 00:06, tsu2 wrote:

>>
>> I don’t think you can have a hostname with a dot in it.

>
> Although a Hostname cannot have a dot in it (the dot is a delimiter),
> there ordinarily is nothing to prevent a Hostname entry to include a
> dot.
>
> So, for instance it’s perfectly legal and functional to create an entry
> in the /etc/hosts file which has more than one dot in the entry.
> But since the dot is a delimiter, technically the entry actually
> describes at least one subdomain (besides the hostname and optional
> domain).

Well, that’s is what I mean.


Cheers / Saludos,

Carlos E. R.
(from 13.1 x86_64 “Bottle” (Elessar))

Thank you for the discussion - I appreciate it. I’m surprised that OS doesn’t automatically put the host name into /etc/hosts for “vanilla” linux installs like mine.

Happy Holidays!!!

Patti :slight_smile:

On 2013-12-23 05:16, PattiMichelle wrote:
>
> Thank you for the discussion - I appreciate it. I’m surprised that OS
> doesn’t automatically put the host name into /etc/hosts for “vanilla”
> linux installs like mine.

It does.

I have:


127.0.0.1       localhost
....
192.168.1.14    Elessar.valinor Elessar

What you get with that tickbox in YaST is this:


127.0.0.1       localhost
127.0.0.2       Elessar.valinor Elessar

....
192.168.1.14    Elessar.valinor Elessar

which is a different thing, and breaks some programs like postfix, but others like sendmail seem to
need it.


Cheers / Saludos,

Carlos E. R.
(from 13.1 x86_64 “Bottle” (Elessar))