How to tweak Linux network files
Published: 07 Jan 2003 09:56 GMT
Although a number of powerful graphic configuration tools are available for Linux, there may be instances -- such as bare bones server installations -- when an administrator will have to configure networking in Linux without the aid of a configuration utility. When this type of setup is needed, you'll have to know exactly what files to modify and how to modify them. I'll show you what files to edit to configure Linux networking manually.
NIC modules
The first thing you need to do is configure the proper module for the server's NIC. To find out what module a specific NIC is using, log on as root and run the /sbin/lsmod command. In the output for this command, you should see a listing similar to:
3c59x 26504 1
This listing will depend upon the card being used. In the example above, the 3c59x is the module being used by the server's NIC. Once you know the NIC's module, open the file /etc/modules.conf and check to see that there is a corresponding entry for the NIC module. If not, you will have to enter a line similar to:
alias eth0 3c59x
This entry assumes that you are using a card compatible with a 3Com 59x card and that it is attached to eth0. (These configurations will depend upon the individual setup.)
Be good hosts
The next step is to configure thehosts file. This file resides in the /etc directory and will contain the localhost entry (a special entry that must be present) and administrator-configured entries. Each entry will take on this form:
IP address Fully Qualified Domain Name (FDQN) alias
The hosts file will look like:
127.0.0.1 localhost.localdomain localhost
192.168.1.2 nickel.nater.org nickel
Notice that both the entries in the above file are private IP addresses. The /etc/hosts file can contain public IP addresses as well. This file is also not limited to two entries. The /etc/hosts file can act as a simple DNS table, so an unlimited amount of entries can be entered.
Resolving DNS
Next, the primary (and secondary, if available) DNS server(s) must be configured. This configuration is taken care of in the /etc/resolve.conf file. This file takes on the form of:
domain nater.org
nameserver 192.168.1.3
nameserver 192.168.1.4
search nater.org
In the above entry, the domain is nater.org, and the primary and secondary DNS servers are listed. The third entry is present in case either the first or second nameserver cannot be found. If neither nameserver is found, bind (the system handling DNS on a Linux server) will search the entire domain (in this case, nater.org) for a nameserver.










