LAN Network setup

Hi all,
we have a problem of gethostbyname fail.
We have 3 PC with openSUSE 11.1, we have set up the network card, static IP, assigned hostnames, ping works fine, but:

  1. how to surf other computers of network?
  2. we have a problem of gethostbyname on a hp-mpich application - how to match every hostname with the correct IP address?
    Thank you very much for your help.
    Cheers

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

I assume you are pointing your machines to a DNS server and you have a DNS
server setup with all of these names (either statically or dynamically).
If that’s not the case, how do you expect this to work? If that is the
case, what do you get when you try to resolve the hostname in your domain
as shown below:

dig @192.168.1.1 host.domain

(where 192.168.1.1 is replaced with your valid DNS server and host.domain
is replaced with the DNS name of your host within your DNS domain).

Good luck.

On 03/07/2011 10:36 AM, andenging wrote:
>
> Hi all,
> we have a problem of gethostbyname fail.
> We have 3 PC with openSUSE 11.1, we have set up the network card,
> static IP, assigned hostnames, ping works fine, but:
> 1) how to surf other computers of network?
> 2) we have a problem of gethostbyname on a hp-mpich application - how
> to match every hostname with the correct IP address?
> Thank you very much for your help.
> Cheers
>
>
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.15 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iQIcBAEBAgAGBQJNdR18AAoJEF+XTK08PnB5YzwP/30DAdXB36/JQpzimFg8bRe4
P0yrY4+LUhDV8tyfxz/25eoyRTDQdO40wbAZzN85PoBN2rBjtQOjB7tX4aQCpfv5
axI2v78k/GcK3n1hyKPu+RVAM7VqlfoBuJDf5pxlMdABq6tBxQg3SE4J3GIuu4+/
r+Bf1UPARx8WlhUjFaAJSuB+0SAKah7HmhSqnXYlUDa7nJEg+WY6gRgXHNqPFarZ
ozD1C988Ayd3avaHX3cn2xdA9iOb6LMz+GPpZw7+nRh0CaB4iY124r/3m+q3yBvd
xG6D69wM19Vs2cjqlMwv0l3hsUUbNmGOJZo6XXEbeYAoM1B7ziffxacGMd3SMliR
r6YWTiouywuqmLoUoSg9AhDW+4T2a5QV7k11WSPYNXaHhstR2GLtPXv8E3hWrDw1
0WmJcoR3Q3Y/B9+ITFatbBGNCxuafOZMsc1w+RDbWpWkCzLtcgTRwvhQ3PDd2ojc
5WfthC1IwmMDpLBHKgvVsJeLQHAotf1mYz/rnRNSU7S/qBxXibw1mc/GaZv47plN
J396cmlcr2BIRgfKqMp47Pu8rALp+M1zvJaWKnhcKXUuw8UweOM6ErxZqbA6znek
XRhBuTZpdNNVaRySeswCDPxIPsnjro0BPRIIwoWcr6VFwOBbfy+tb1gNrWG68vaS
IADDey9nCKDngq5FCcVR
=R6Qm
-----END PGP SIGNATURE-----

You either should have a DNS server in your LAN that serves the local names (and fowards to internet DNS servers for other requests), or you put all of them in the /etc/hosts files on all systems (which sounds like a lot of work, but think of tools like rsync to organise this).

  1. how to surf other computers of network?

If you mean how to access data stored on other computers on your lan, such as documents, images, music, video etc take a look at samba and nfs shares

Both work well and if you have any windows machines on the lan then samba would be the one to use

Hi Ecky

does samba work both with windows and suse OS?

Thanks
Cheers

Dear Mr. Van Velden,
thank you for your reply.
Could you please be so kind to explain a step-by.step rpocedure to set up a DNS server for the LAN?
We’re quite new users of openSUSE and are not so sure how to manage a DNS server.

Following he other way, what should we write in the etc/hosts/ file?
Consider that we have the following parameters:
name of PC nr.1= Cad1 IP=192.168.0.70
name of PC nr.2= Cad2 IP=192.168.0.20
name of PC nr.3= Cad3 IP=192.168.0.50
Domain name=fantini

Thank you so much for your help, it’s the first time we join a forum but it seems it will help us a lot. It’s a good thing having somebody that can help you.
Cheers

Your originaly question seemed to me to be clear enough (about gethostbyname()) and I assume you know what you are talking about. But Samba nor NFS, though using functions like* gethostbyname()*, are a solution to what you ask. As long as you can not resolve the names, you can not connect to the other fiile systems by name for any type of connection (including Samba and NFS, or HTTP or SSH for that matter), but you can by IP address.

I do not know what yuo mean by “surfing the other computers of the network”. Do they have web-servers and do you use “surfing” as a popular term for browsing the HTTP world-wide-web?
Samba is a Unix/Linux implementation for file/printer sharing with MS windows systems.
NFS (Network File Sharing) is what it’s name says in the Unix/Linux world.

The contents of /etc/hosts is described in it’s man page (as most basic tools/configuration files are). Thus do

man hosts

You should allready have some contents there and you could add the other systems entries there. You can do so with any editor (as root) or by using YaST > Network Services > Hostnames. This window explains itself imho, but you can post questions here of course.

(I will be away the next two days, thus when no others come he to help you further, you have to wait :wink: )

Addition about your question creating a DNS server.
This is not an easy thing to do and not worth the trouble when you only have those three systems (or even say about 10 as a total in your LAN).

Sorry, I am a bit piecemeal to day, doing o many thiongs at the same time.

The suggestions about a DNS server made above by several people are because in most home LANs one uses the DHCP service from the router provided by the ISP to get the IP addresses and also the address of aDNS server, which is often that same router. Thus people here want to know what DNS server is used in your LAN.

Do not forget you did not explain much about that LAN. As far as I can read it, you can have only the three systems mentioned by you, but you can have many more. The LAN can be a home LAN with a router to the ISP, it can be a big LAN from a big enterprise, with more LANs, coupled by a WAN and connected to the internet via proxys and firewalls. Difficult for us to guess your environment and your level of knowledge.

Dear Mr. Van Velden,
thank you for your messages.
Our openSUSE LAN is actually a very simple network of just 3 PC (for the moment).
All we would like to do is connect these 3 PC together, in order to be able to share files, and see folders and files of one PC from the others.
Since some of our programs need a hp-mpich application, we need to resolve the problem of gethostbyname() failing.
So we would like to know what is for us the best way to assign to each PC the right hostname and IP address.
Thankis a lot in advance.
Cheers

On each PC you asign it’s hostname with YaST (that should have happened allready during installation). And you add the other two hostnames in /etc/host also with YaST as I have outlined above.

The easy way to check is by using ping to the name of the other host. That will show you if the name can be resolved and it will show you if there is a connection. Very basic.

Dear Mr. van Velden,
thabk you for your message. We’ve set up all hostnames with yast, set up etc/hosts with yast, run ping and it works. But we tried to see folders on other computers with samba and it doesn’t work. We cannot find the way to see folders and files of one PC from another, even if the ping works.
Basically we cannot work out the way to share and see folders via LAN.
Also our error of gethostbyname() has changed, now it is no more gethostbyname() failing, but it says: mpirun: rsh: command not found.
Any suggestion?
Thanks a lot
Cheers

Of course ping only showes that you have network connection, and by using the hostname (and not the IP address) with ping it shows that your host name resolution (your gethostbyname() problem) is solved. And that was what you asked for.

I do not know anything about mpirun. But the fact that it complains about rsh Rremote Shell) not found seems logical as it is not available on my system either. The Remote Shell client (rsh) and server (rshd) are available on the OSS repo, but they are not installed by default because it is a very old-fashioned and insecure way to work with. Nowadays SSH is used for this.

I assume that using the term “see folders and files of one PC from another” is a typical Microdoft Windows way of expressing something. When you mean with this that it must be possible to share things on disk between the systems, it is very logical that that is not happening automaticaly. That would be against every security rule.

Samba is for sharing disk space (and printers) with MicroSoft Windows systems and you are only talking of openSUSE systems. When one want to share certain parts of ones directory tree on one Unix/Linux system with other systems, one uses NFS. As I am not a MS windows user, I do not know how you should use Samba, but there is a good tutorial here: openSUSE SuSE Linux HOWTOs and Tutorials by Swerdna
When you have problems using Samba, ask in a seperate thread that mentions at least the word Samba in it’s title, thus luring the people that know something about Samaba into reading it. And I encourgae you to mention facts in such a thread. Thus not “we tried to see folders on other computers with samba and it doesn’t work.” (much to vague), but post the Samba configuration files you have in your thread.

1: Can you tell me what MPICH does for you and how that relates to “surfing” other computers?

2: Samba is a nickname for the SMB protocol for sharing resources (amongst them file and printer sharing) between computers. The SMB protocol is favoured by microsoft for sharing resources and it also works very well in Linux. In Linux and Unix there is another protocol that works to do these things called NFS. You can choose one or the other. I don’t see a reason to favour one over the other (except patriotic feelings). (and maybe NFS is a bit easier to set up than Samba).