General index of the series: Computer Networks for SMEs: Introduction
The main purpose of this article is to show how we can achieve a DNS and DHCP server in openSUSE using its magnificent YaST configuration tool, and all – or almost all – through its graphical interface.
We promise you a complete installation via a graphical interface, with the exception – every rule has its exception, right? – of a couple of consoles to check the correct operation of the Bind9 + ISC-DHCP-Server pair , configured using YaST – Yet another Setup Tool , which is a set of very good tools for software management and system configuration.
The first service—and the most important in our opinion—that should be implemented in an SME network is the DNS / DHCP service . If we don't want to manually configure the network parameters of each workstation, we shouldn't do without the DHCP service, as explained later. There is also the time-based service, or NTP.
DNS: background
In April 2013, we published a series of 5 articles on DesdeLinux dedicated to implementing a primary DNS on Debian:
- Primary Master DNS for a LAN on Debian 6.0 (I)
- Primary Master DNS for a LAN on Debian 6.0 (II)
- Primary Master DNS for a LAN on Debian 6.0 (III)
- Primary Master DNS for a LAN on Debian 6.0 (IV)
- Primary Master DNS for a LAN on Debian 6.0 (V)
A compilation of the previous articles was even offered for download in HTML format. Although they were written – at that time – with the Debian release "Squeeze", the definitions and concepts discussed in them remain fully valid.
That is why we are not going to do a formal Introduction to the DNS issue. Read these articles if you have any questions, and they also provide links to specialized DNS literature.
In openSUSE , the most important folders and files related to this service are:
- archive /etc/named.conf
- binder /etc/named.d
- archive / etc / sysconfig / named
- programs / usr / sbin / named-checkconf, / usr / sbin / named-checkzone, / usr / sbin / named-compilezone, / usr / sbin / named-journalprint
- binder / usr / share / doc / packages / bind /
- binder / var / lib / named /
- binder / var / lib / named / dyn /
- archive /etc/init.d/named
- symbolic link / usr / sbin / rcnamed
DHCP
The purpose of the Dynamic Host Configuration Protocol (DHCP) is to centrally assign network configuration parameters—using a DHCP server—instead of manually configuring each workstation. A computer configured using DHCP has no control over its static IP address. This client computer is configured to automatically configure its network according to the server's directives.
The DHCP service makes life easier for network administrators. By configuring the DHCP server, you can define parameters such as domain name, gateway, time server, DNS servers, WINS server (if used), broadcast IP address , client computer IP address and subnet mask, client computer name, and many other parameters.
Any changes, even major changes to the parameters relating to IP addresses and network settings, can be implemented centrally, if we edit or change the DHCP server settings.
Typically, the DHCP server maintains a complete record of assigned IP addresses, or leases, and the key parameter is usually the MAC address of each network interface card (NIC ). In openSUSE, the leased IP addresses granted by DHCP are stored in the file /var/lib/dhcp/db/dhcpd.leases.
The dhcp-doc package , which is installed in the /usr/share/doc/packages/dhcp-doc folder , offers very good documentation -in English- about this service.
The DHCP server configuration file is /etc/dhcpd.conf . Another DHCP configuration file is /etc/sysconfig/dhcpd , and this is where you define which network interface—or interfaces—the server will respond to.
And since we are in the middle of the systemd era , we also have the file /usr/lib/systemd/system/dhcpd.service.
As promised not to use the console, we'll leave the rest of the investigation to the bash enthusiasts . For the record, the console doesn't bite.
Suggestions
Although we promised not to use the console, except a couple of times, we suggest you run the following commands – as root – after the DNS-DHCP service has assigned at least one dynamic IP address, which assumes that you have completed the full installation of both services and are in the testing phase:
- systemctl status named.service
- systemctl status dhcpd.service
- systemctl status dhcp-server.service
- named-journalprint /var/lib/named/dyn/desdelinux.fanX.jnl
For those suffering from " versionitis, " we recommend taking a look – especially at the dates in the headings – at the archives:
- /etc/init.d/named
- /etc/init.d/nfs
- /etc/init.d/cifs
- /etc/init.d/rpmconfigcheck
and in general to all files in the /etc/init.d folder.
DNS queries made by Windows clients
Again, in a console, run the following command as the root user:
- journalctl -f
Take some time to observe how Windows clients make repeated DNS queries to sites outside the corporate LAN. The example in this article does not include any forwarders , for the explicit purpose of demonstrating this feature of Microsoft® Windows operating systems.
The kernel that installs openSUSE with desktop environment
- It is our preference to use a core as stable as possible for the servers. Then we suggest the procedure to achieve it.
Since we selected an installation with the LXDE desktop, openSUSE installs the " kernel-desktop " optimized for desktops by default.
If we later want to use the default kernel , we simply need to install it using the YaST Package Manager, restart the system, choose " Advanced Options for openSUSE " on the startup screen, and select the default kernel . The versions of both kernels are the same.
Finally, we must remove the kernel-desktop package using the same Package Manager, as GRUB considers it more up-to-date than the kernel-default package and will always select it as the first option if it exists. Since we don't particularly enjoy tinkering with GRUB , we prefer to remove the desktop kernel simply because we won't be using it anymore.
Note : When you remove kernel-desktop from the system , all installed versions of that kernel are automatically removed. You can verify this by selecting "Advanced options for openSUSE" again on the login screen.
Important advice
- Do not embark on the adventure of implementing a DNS - DHCP service with any operating system, without first being clear about the fundamental theoretical concepts. With services as important to a network as DNS, conceptual errors pay dearly in a production environment.
Services that we can disable to save resources
By means of the YaST «Service Manager» module, once the entire installation is finished and in order to save hardware resources, we can disable a series of services that, in this particular case, are not necessary. Examples:
- cups: printing system Common Unix Printing System
- lvm2-lvmetad: Logical Volume Manager metadata daemon, only if we are not using logical volumes
- ModemManager: Modems Manager
Abbreviations
I'm an enemy of translations, ok?
- GRUB: command console GRand Unified Bautoloader
- NTP: Network Time Protocol. Protocol used for the synchronization of the clocks of different computers through the networks
- LAN: Local area network - Local Aarea Network
- SPF: "Sender Policy Framework«. Anti SPAM mechanism that allows a mail server to verify that the SMTP source is valid for the address of sending an email.
- TSIG: Transaction Signature - Transaction SIGnature. Defined in the RFC 2845 "Secret Key Transaction Authentication for DNS«
- UUID: Unique Universal Identifier - Universally Unique Identifier
Step-by-step installation through images
We captured a total of 71 screenshots to provide the most accurate step-by-step guide possible. On each installation screen, openSUSE makes things easier by including a Help button, usually located in the bottom left corner.
We won't provide a description for each screenshot, as we consider it redundant. As the saying goes, " A picture is worth a thousand words ."
Image 01 - DNS and DHCP in openSUSE
Image 02 - DNS and DHCP in openSUSE
Image 03 - DNS and DHCP in openSUSE
Image 04 - DNS and DHCP in openSUSE
Image 05 - DNS and DHCP in openSUSE
Image 06 - DNS and DHCP in openSUSE
Image 07 - DNS and DHCP in openSUSE
Image 08 - DNS and DHCP in openSUSE
Image 09 - DNS and DHCP in openSUSE
Image 10 - DNS and DHCP in openSUSE
Image 11 - DNS and DHCP in openSUSE
Image 12 - DNS and DHCP in openSUSE
Image 13 - DNS and DHCP in openSUSE
Image 14 - DNS and DHCP in openSUSE
Image 15 - DNS and DHCP in openSUSE
Image 16 - DNS and DHCP in openSUSE
Image 17 - DNS and DHCP in openSUSE
Image 18 - DNS and DHCP in openSUSE
Image 19 - DNS and DHCP in openSUSE
Image 20 - DNS and DHCP in openSUSE
Image 21 - DNS and DHCP in openSUSE
Image 22 - DNS and DHCP in openSUSE
Image 23 - DNS and DHCP in openSUSE
Image 24 - DNS and DHCP in openSUSE
Image 25 - DNS and DHCP in openSUSE
Image 26 - DNS and DHCP in openSUSE
Image 27 - DNS and DHCP in openSUSE
Image 28 - DNS and DHCP in openSUSE
Image 29 - DNS and DHCP in openSUSE
Image 30 - DNS and DHCP in openSUSE
Image 31 - DNS and DHCP in openSUSE
Image 32 - DNS and DHCP in openSUSE
Image 33 - DNS and DHCP in openSUSE
Image 34 - DNS and DHCP in openSUSE
Image 35 - DNS and DHCP in openSUSE
Image 36 - DNS and DHCP in openSUSE
Image 37 - DNS and DHCP in openSUSE
Image 38 - DNS and DHCP in openSUSE
Image 39 - DNS and DHCP in openSUSE
Image 40 - DNS and DHCP in openSUSE
Image 41 - DNS and DHCP in openSUSE
Image 42 - DNS and DHCP in openSUSE
Image 43 - DNS and DHCP in openSUSE
Image 44 - DNS and DHCP in openSUSE
Image 45 - DNS and DHCP in openSUSE
Image 46 - DNS and DHCP in openSUSE
Image 47 - DNS and DHCP in openSUSE
Image 48 - DNS and DHCP in openSUSE
Image 49 - DNS and DHCP in openSUSE
Image 50 - DNS and DHCP in openSUSE
Image 51 - DNS and DHCP in openSUSE
Image 52 - DNS and DHCP in openSUSE
Image 53 - DNS and DHCP in openSUSE
Image 53-A - DNS and DHCP in openSUSE
Image 54 - DNS and DHCP in openSUSE
Image 55 - DNS and DHCP in openSUSE
Image 56 - DNS and DHCP in openSUSE
Image 57 - DNS and DHCP in openSUSE
Image 58 - DNS and DHCP in openSUSE
Image 59 - DNS and DHCP in openSUSE
Image 60 - DNS and DHCP in openSUSE
Image 61 - DNS and DHCP in openSUSE
Image 62 - DNS and DHCP in openSUSE
Image 63 - DNS and DHCP in openSUSE
Image 64 - DNS and DHCP in openSUSE
Image 65 - DNS and DHCP in openSUSE
Image 66 - DNS and DHCP in openSUSE
Image 67 - DNS and DHCP in openSUSE
Image 68 - DNS and DHCP in openSUSE
Image 69 - DNS and DHCP in openSUSE
Image 70 - DNS and DHCP in openSUSE
Image 71 - DNS and DHCP in openSUSE
Installation support
As an installation medium, we can use a DVD image like the one we used to create this post, openSUSE-13.2-DVD-x86_64.iso , or a more recent version. If the computer doesn't have a DVD drive, or if it's more convenient to use a USB flash drive , we can create one as described in the article " Autoboot USB Flash Drive for Installing Debian, CentOS, or openSUSE ." After installing the operating system, to prepare the USB flash drive, you can install and use the Imagewriter program from SUSE Studio.
However, we suggest you initially try it in a virtual machine.
Installation, declaration of repositories and system update
- We suggest for virtual server dns.desdelinux.fan about 768 megabytes of RAM and a 20 GiB hard drive. The memory is because we will do it with a graphical interface.
- In 05 imageRegarding the Network Configuration, we do not declare any Name Server because that function is the one to be installed. If you declare some other server, it will be considered as a redirector - forward, and we want to implement the service in this way to check the insistence of Microsoft® Operating Systems in their search for sites on the Internet.
- We create a very personalized configuration of partitions according to our particular taste. Feel free to choose and implement the one you prefer.
- Imagen 15: "Fstab options". We choose that the partitions are mounted according to their LABEL - LABEL and not according to its UUID, which is the default option. After installing the system read the contents of the file / etc / fstab.
- The NTP server to synchronize the time is precisely the Host Hypervisor where the DNS - DHCP server runs.
- In the same way that we selected the LXDE desktop because it perfectly fits our needs, you can choose any other one offered by the installer of the openSUSE.
- The name of the chosen user «buzz» is to honor our favorite distribution. Nothing more. 
- In 22 imageNote that we open the SSH port in the Firewall, and also enable the SSH service.
- Please take your time when choosing the software to install. The magnificent Package Manager, as shown in the 23 image.
- Images 35, 36, 37 and 38: After installing the operating system from the DVD or other media, the first thing we must do is declare the repositories to update our system, whether they are local or on the Internet. In our case, we disable the different repositories that openSUSE offers on its servers on the Internet, and we add ours that are Local. Namely, we have the repositories Database, Packman, Updates, Oss y non-oss, enough for the proposed work, and to make us a fully-fledged desk. 
- Images 39 and 40: Starts and ends the update of the Package Manager of the YaST. On the first screen we leave the default selections. We just clicked the button Apply.
- Images 41, 42 and 43: After the Package Manager updates itself, it launches the screen with the packages from the rest of the system to be updated. In it, we also accept the default selections.
- Imagen 44: Classic screen to end a session in LXDE.
Installation and configuration of DNS and DHCP services in openSUSE
- Imagen 47: Let's not forget to generate the secret key for the dynamic update of the DNS zones, which are desdelinux.fan y 10.168.192.in-addr.harp.
- Imagen 49: Let's take a good look at the box that appears at the top «Settings for the zone desdelinux.fan«. We allow dynamic updates and zone transfer for the local network nothing else.
- Imagen 53: If we display the list «Type:»Of DNS records, we will find that we can declare the following:
- A: IPv4 domain name translation
- YYYY : IPv6 domain name translation
- CNAME: alias for the domain name
- NS: name server
- MX: mail transmission
- SRV: SRV service registry, widely used in Active Directory and other services
- TXT: Text registration
- SPF: Sender Policy Framework
- Imagen 54: openSUSE makes our lives easier by not having to declare reverse DNS records. We also allow dynamic reverse zone update and zone transfer for the local network.
- Imagen 55: After finishing the DNS configuration, nothing better than to check its operation and correct configuration, by means of a couple of simple console commands.
- Imagen 56: Before configuring DHCP, we must assign to the network interface that we will select for that service - it can be one or more interfaces - a Zone in the Firewall. We select the Internal Zone which is that of our LAN.
- Images 61 and 62: To declare the dynamic DNS we must go to the «Expert DHCP Server Configuration«.
- Imagen 63: We select the subnet and click on the button «Advanced«, And select the option«TSIG key management«.
- Imagen 64: We select the TSIG key generated during the DNS configuration. If you didn't do it then, you can do it now and reconfigure the dynamic update of DNS zones according to the key generated here.
- Imagen 65: We return to the selected subnet and now we click on the button «Edit«.
- Imagen 66: We select the Range of our interest and click on «Dynamic DNS«.
- Imagen 68: We started the team opensuse-desktop.desdelinux.fan which is the object of our next article, the one that we install and configure with the dns.desdelinux.fan running, and we check with a couple of simple console commands that DHCP correctly updated DNS, and that the forward and reverse DNS records for that client are returned.
Join us on the next adventure!