From Fedora Project Wiki

Description

dnsmasq is a lightweight, easy to configure DNS forwarder, DHCP server, and TFTP server. It is designed to provide DNS and, optionally, DHCP, to a small network.This test case ensures that the dnsmasq package is working as expected. It is designed to verify that dnsmasq can successfully function as a DNS forwarder and a DHCP server.

Setup

  1. Install the version of Fedora that is to be tested on a bare metal or virtual system.
  2. Install the dnsmasq package using the command: sudo dnf install dnsmasq.

How to test

  1. Open a terminal window.
  2. Configure dnsmasq to act as a DNS forwarder:
  3. Edit the /etc/dnsmasq.conf file to set up DNS forwarding. For example, add a line such as server=8.8.8.8.
  4. Restart the dnsmasq service with the command: sudo systemctl restart dnsmasq.
  5. Test the DNS forwarding by querying a domain name, e.g., dig example.com @localhost.
  6. Configure dnsmasq to act as a DHCP server:
  7. Edit the /etc/dnsmasq.conf file to set up the DHCP range and other DHCP options. For example, add lines such as dhcp-range=192.168.1.50,192.168.1.150,12h.
  8. Restart the dnsmasq service with the command: sudo systemctl restart dnsmasq.
  9. Test the DHCP server by requesting an IP address from another machine or a virtual machine in the same network.

Expected Results

  1. The dnsmasq package installs without error.
  2. The DNS queries are successfully forwarded to the specified DNS server and responses are received.
  3. The DHCP server successfully assigns IP addresses to clients in the specified range, and the clients can use these IP addresses to communicate in the network.
  4. The dnsmasq service starts without errors and the status can be checked with sudo systemctl status dnsmasq.

Optional

  1. Test dnsmasq in different network configurations and scenarios (e.g., multiple subnets, different ranges of DHCP addresses).
  2. Test the TFTP server functionality of dnsmasq.
  3. Check the logs (usually in /var/log/) for any unexpected errors or warnings.
  4. Test the behavior when upstream DNS servers are unreachable.
  5. Test dnsmasq's performance under load, e.g., when many clients are making DNS queries or requesting DHCP leases at the same time.