Install and Configure dnsmasq in Ubuntu 18.04

Keywords: Install dnsmasq, Ubuntu 18.04, DNS, DHCP

Follow the steps mentioned in this post to install dnsmasq in Ubuntu 18.04 LTS.

 Step 1. Free port 53 to use with dnsmasq

Ubuntu 18.04 uses systemd-resolve service that is bind with port 53.

Execute following commands to disable and stop this service.

Remove the symlinked file and remove old /etc/resolv.conf file.

Before removing old file, make a backup copy in case something goes wrong.

Step 2. Create a new “resolv.conf” file

Execute following command to create the file with required content in it.

Step 3. Install “dnsmasq” using apt repository

Step 4. Check version after Installation

Step 5. Add DNS records to dnsmasq

Open /etc/hosts file and add the records. I have added with IP

After adding required DNS records restart dnsmasq service to take effect.

Step 6. Check dnsmaq Functionality using ‘dig’

Execute following command

You will see the output like below screenshot. You can see the IP it returned is (we added it in DNS records)

Please like and share Techawarey.  Find and Like Techawarey on Facebook.😊

Related posts

Leave a comment....