| Configuration
files: The /etc/hosts Tcp/ip is a fine 3rd-4th network level (levels according to the OSI standard) It can create huge networks and can "understand" routes. It does not rely on broadcast, though, to resolve a hostname, like Netbios does, for example. So, to resolve a name you can either: query a name server (in the internet we call it DNS) or know the ip adresses manually. We will discuss the second option here, since it is perfect for small Local Area Networks created with tcp/ip. A hostname is the name that defines your computer in the network. A Domain name is the name of your entire (local) network. If a domain name is: myhome If I have two hosts: foo and bar then their hostnames would also be: foo.myhome and bar.myhome Let's assume that they both belong to a class C network: network: 192.168.0.0 broadcast 192.168.0.255 as you can see, in a class C network you can have 254 hosts. In a class C network only the last numbers change. If foo is configured to: 192.168.0.1 If bar is configured to: 192.168.0.2 Let's make them see one another without a running name server: the /etc/hosts configuration file in foo should be: 127.0.0.1 localhost 192.168.0.1 foo.myhome foo 192.168.0.2 bar.myhome bar the /etc/hosts configuration file in bar should be: 127.0.0.1 localhost 192.168.0.2 bar.myhome bar 192.168.0.1 foo.myhome foo As you see, the hosts have to be resolved in both ways: host AND host.domain Q: What is this localhost thing? A: It's the host and the network address to resolve, to connect to itself! The loopback interface in other words. Let's say that you have a server running locally i.e. web server. If you want to test it, you don't have to connect through another computer. You can type in the address of your browser: http://localhost and you are there! There are other reasons, but for now remember that in this way you can connect locally to your own servers. There are certain deamons that respond to a tcp/ip request trough ports. Usually they are friendly configuration interfaces that can be seen locally and remotely within a web browser. Localhost is for the local connection. Anyway, you can test whether your local telnet server is up: telnet localhost or whether your ftp server is up and running: ftp localhost If there's another problem like you do not have chosen ip addresses for your machines or they belong to different network address, then you definetly must configure them right, and then visit and edit the /etc/hosts in them. If you want to do it by hand then: Be sure that kernel has loaded the module for your network interface card in each host: lsmod My modules is 8139too generic for Rtl8139 based network interface cards and via_rhine for Via Rhine & RhineII based network interface cards. Then, use ifconfig but read the manual page carefully. If all goes well, then you definetly want it to be permanent so visit your /etc dir and find the configuration file that has the ifconfig command: cd /etc ; grep -l ifconfig $(find -iname '*') If you find many then ls -l them to see which is a real file and which are soft links.
Sometimes this file is named most probably rc.inet1. rc.inet1 can be found in a directory inside /etc that is usually called init.d or rc.d Edit the appropriate network numbers and you are there! It is not as difficult As It Seems! Q: Can I use the wizards? A: Of course, but the alteration of the system through a direct change to the configuration files is a more Unix oriented behavior towards your GNU/Linux or *BSD Box. In any *.nix, network modules, interfaces (addresses, gateways) and nameservers can be brought up, down or changed anytime without rebooting. |