padpowell@wateng.UUCP (PAD Powell [Admin]) (05/17/84)
<munch> I have been trying to find a way to set up the networking data base to allow me to get a "unique" host name. The problem is the following. We have two networks, mathnet (1) and async (2) [Forget the numbers, they are changed to make life easy]. The host "watmath" is on both networks, and the /etc/hosts file looks like: 1.1 watmath 1.2 watdaisy 2.1 watmath-x 2.2 wateng To start up the network, watmath has an entry in the /etc/rc.local file /etc/ifconfig eu0 watmath /etc/ifconfig ttif0 watmath-x Similarly, wateng has an entry /etc/ifconfig ttif0 wateng /etc/route add mathnet watmath-x 1 This procedure has the following interesting property: all messages from watmath arriving at wateng are tagged as coming from watmath-x; this is the result returned by "gethostbyname(3n)", in the h_name field. What I would like to do is assign an "official name" to watmath, which would always be returned by "gethostbyname(3n)". In addition, I would like to be able to use this name for naming the host. My first thought was to change watmath-x to watmath, and leave it at that; this would cause conflicts in names. It seems to me that there should be a way to do this; I cannot find an example, and am a little leary of experimenting. Secondly, is the /etc/route line neccessary? If it is, can an entry in /etc/gateways be used instead? and if it can, what is the format? Finally, can anybody explain or give a pointer to a written explanation of the relationship between the files /etc/hosts, /etc/networks, and so forth, and the programs or operating system parts that use them? I have read the implementation document, but am still a little puzzled. Patrick Powell VLSI Research Group, U. Waterloo