16.5. Changing the Hostname or DNS Client Settings

Every UNIX system has a hostname, which appears in the login prompt, system logs, outgoing email and on every Webmin page. Normally the hostname is the same as or part of the DNS name for the system's IP address, but this does not have to be the case, especially if the system is not connected to a network or only connects occasionally via dialup. However, for permanently connected systems the hostname should be the hosts fully qualified DNS name (like server1.foo.com), or just the first part (like server1). Anything else is likely to cause confusion and possibly network problems.

When a Linux system is first set up, you get to choose the hostname as part of the distribution's installation process. However, it can be changed at any time, either using Webmin, a GUI tool provided by the distribution, or the hostname command. To make the change in Webmin, the steps to follow are:

1.
On the main page of the Network Configuration module, click the DNS Client icon. This will take you to the form for editing the hostname and DNS options shown in Figure 16.3.

Figure 16.3. The DNS client and hostname form.


2.
Enter the new hostname (composed of letters, numbers, underscores, and dots) into the Hostname field.

3.
Click the Save button to have it immediately changed. Your browser will be returned to the module's main page.

4.
Change the host address for your old hostname to the new one, as explained in Section 16.6 “Editing Host Addresses”.

5.
If you are running a DNS server, don't forget to update the entry for your system there as well.

As explained in the introduction to this chapter, in order to look up hostnames and IP addresses your system will almost certainly need to know the addresses of DNS servers on the network.

To change the system's DNS settings, follow these steps:

1.
Click on the DNS Client icon on the main page of the module, which will take you to the form shown in Figure 16.3.

2.
Enter the addresses of up to three servers into the DNS servers field. If the first is not available, your system will try the second, and finally the third. Most networks will have at least a primary and secondary DNS server to increase reliability in case one fails.

3.
The Resolution order field can be used to control where your system will look when resolving hostnames and IP addresses. Generally the defaults are reasonable, with Hosts (the /etc/hosts file) listed first and DNS later. However, if you are using NIS for hostname resolution you will need to make sure it is selected somewhere in the order.

4.
In the Search domains field, enter any domain names that you want your system to automatically append to resolved hostnames. For example, if foo.com was listed and you ran the command telnet server1 then the IP address for server1.foo.com would be looked up.

5.
When done, click the Save button. Any changes will take effect immediately in all programs running on your system.

If your system's only network connection is via dialup, the DNS servers may be assigned automatically by your ISP depending on your PPP configuration.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
18.227.48.131