Your internal network is growing, and you're having trouble keeping up with the different workstations that are being added to your network on a regular basis. You use the good.example.com subdomain for your internal network, and you've named your computers for your departments, such as engr1 through engr10.good.example.com. Your mail server is named postal, your Web server is named www, your FTP server is named ftp. You want to configure a DNS server on the computer named names. What do you need to do? While you may not have enough information in this lab to create a complete and working file, you should be able to figure the outline of what you need to do, with the possible exception of specific IP addresses. |
Answers
While you could subcontract out the task to an ISP, it's easy to create a DNS server for your internal network. The basic files are already available on RHEL 3. All you need to do is modify these files and add appropriate zone files to your /var/named directory. As there are problems with the Red Hat DNS Server Configuration tool, I'll describe the basics on how you can set up a DNS server by directly editing the appropriate configuration files. Assume that you're using the 10.11.12.0/255.255.255.0 network addresses for your LAN. First, you'll need to modify the default /etc/named.conf configuration file. It's best to start by backing up this file. You'll need to add stanzas that refer to a zone and a reverse zone file. The stanzas are straightforward: zone "good.example.com" IN { type master; file "good.example.com.zone"; }; zone "12.11.10.in-addr.apra" IN { type master; file "good.example.com.rr.zone"; allow-update { none; } }; Next, you can create the good.example.com.zone and good.example.com.rr.zone files in the /var/named directory. These files will contain a database of local and reverse local computer names and IP addresses for your LAN. In the good.example.com.zone file, you'll want to create the forward database for your DNS server. It'll contain the records for your domain as well as the administrator e-mail address. There's not enough information in the problem to set up a full file, but the following principles apply. You need to start the zone file with a general Time To Live (TTL) variable; for example, the following command sets a standard TTL (4 days) for data on this DNS server: $TTL 4D You'll need a Start Of Authority (SOA) record with the name of the DNS server and your administrative e-mail address. The format of the e-mail address is a little strange; the following line sets an e-mail address of ifconfig commands on each computer: engr1 IN A 10.11.12.1 engr2 IN A 10.11.12.2 engr3 IN A 10.11.12.3 engr4 IN A 10.11.12.4 engr5 IN A 10.11.12.5 engr6 IN A 10.11.12.6 engr7 IN A 10.11.12.7 engr8 IN A 10.11.12.8 engr9 IN A 10.11.12.9 engr10 IN A 10.11.12.10 ftp IN A 10.11.12.11 www IN A 10.11.12.12 postal IN A 10.11.12.13 Finally, to make sure that the DNS server works the next time you boot this Linux computer, you'll want to set it to run at the appropriate runlevels with a command such as the following: # chkconfig --level 35 named on |
Answers
This lab is the first step towards creating a single /home directory for your network. Once you get it working on a single client/server combination, you can set it up on all clients and servers. You can then use the NIS server described in Chapter 10 for a single Linux/Unix database of usernames and passwords for your network. On the NFS server, you'll want to take the following steps: Set up some users and special files that you'll remember in some of the user's home directories on the server. The details are not important-just make a note of what you've done.
Share the /home directory in /etc/exports. You'll want to share it with the nfsclient.example.com client. You can do this in this file with the following command: /home nfsclient(rw,sync) Export this directory with the following command: # exportfs -a Restart the NFS service: # service NFS stop # service NFS start Make sure that the exported /home directory shows in the export list. On the local server, you can do this with the following command: # showmount -e If you have problems with any step in this process, make sure you don't have extra spaces in /etc/exports and that the NFS service is actually running with the service nfs status command. You may also want to check your firewall and make sure the appropriate services described in this chapter are running with the rpcinfo -p command.
Remember to make sure that the NFS server starts automatically the next time you boot that computer. One way to do so is with the following command: # chkconfig --level 35 nfs on Now on the NFS client, you'll want to take the following steps to connect to the shared /home directory:
First, you'll want to make sure that you can see the shared /home directory. If your DNS server is not working in any of these commands, you can substitute the IP address of the appropriate computer: # showmount -e nfssvr.example.com Now you'll want to mount the share that is offered on the local /home directory: # mount -t nfs nfssvr.example.com:/home /home Check to see that the mounting has worked. If it did, you'll see the NFS mount in the output to the mount command.
Now look through the mounted /home directory for the special files that you created in step 1. If you find them from the NFS client, you've succeeded in creating and connecting to the /home directory share.
To make the mount permanent, you'll want to add it to your /etc/fstab file. Once you've added a command such as the following to that file, the Linux client automatically mounts the shared /home directory from the NFS server. nfssvr.example.com:/home /home nfs soft,timeout=100 0 0
|
You'll also need two Linux computers for this lab: one as a DHCP server, a second as a DHCP client. Using the DHCP server created earlier in this chapter, set up a static IP address for the computer of your choice. You'll want to assign a specific name for that server, precious.example.com, and a special IP address on the 10.11.12.0 network, 10.11.12.13. Assume that you've already set up the example.com network as well as an appropriately configured DNS server. |
Answers
Assuming you've read the chapter, you've seen the template in the dhcpd.conf.sample configuration file for a static IP address: host ns { next-server marvin.redhat.com hardware ethernet 12:34:56:78:AB:CD; fixed-address 207.175.42.254; } As described in the chapter, the next-server command is associated with the boot server for this computer; since there is no boot server mentioned, you won't need this command. To set up the DHCP server, take the following steps:
On the DHCP server computer, open the /etc/dhcpd.conf file. If this file doesn't exist, you haven't yet created a DHCP server on this computer.
Set up a new host in the DHCP configuration file: host precious { On the DHCP client, run the ifconfig command to find the hardware address associated with that computer's Ethernet network card. For the purpose of this exercise, assume it's AB:CD:EF:12:34:56; the host command line continues as follows: hardware ethernet AB:CD:EF:12:34:56 Finally, you can complete this line by setting up the static IP address that you want to assign to the DHCP client computer: fixed-address 10.11.12.13 } Save your changes to the /etc/dhcpd.conf configuration file. Restart the DHCP server daemon with the following command: # service dhcpd restart Now proceed to the DHCP client, the precious.example.com computer. You can release any current DHCP client with the following command: # dhclient -r Finally, you can see if the DHCP client actually takes the static IP address from the DHCP server with the following commands: # dhclient # ipconfig |
Answers
You need to configure a few services on your central host. NIS can be used to manage all the users so that all hosts use the same user IDs. Then configure a central server with Samba and NFS and sufficient disk space for the four groups, restricting each service to members of each group only. Use NTP to synchronize the NFS server to an Internet time server, if available, and then have all the other hosts synchronize their time to the NFS server host on an hourly basis. As NIS is covered in the next chapter, I don't go into additional detail here. |