---
title: dnsmasq
url: 'https://inetsys.network/blog/dnsmasq'
markdown: 'https://inetsys.network/blog/dnsmasq.md'
date: '2026-10-20'
description: 'Deploy a lightweight, easy-to-control local DNS server on Ubuntu using Dnsmasq. Includes step-by-step instructions to disable systemd-resolved port conflicts and run our automated installer. 🌐 Ligh'
---

# [dnsmasq](https://inetsys.network/blog/dnsmasq)

   20th Oct 2026  

Deploy a lightweight, easy-to-control local DNS server on Ubuntu using Dnsmasq. Includes step-by-step instructions to disable systemd-resolved port conflicts and run our automated installer.

# 🌐 Lightweight DNS Server Setup with Dnsmasq

![Ubuntu](https://img.shields.io/badge/Ubuntu-20.04+-E95420?style=flat-square&logo=ubuntu&logoColor=white) ![Service](https://img.shields.io/badge/DNS-Dnsmasq-29c5ff?style=flat-square) ![Port](https://img.shields.io/badge/UDP/TCP-Port_53-26e0ad?style=flat-square) ![License](https://img.shields.io/badge/By-Inetsys.network-blue?style=flat-square)

**Dnsmasq** is a lightweight, easy-to-configure DNS forwarder and DHCP server available directly in the official Ubuntu repositories. It is ideal for custom VPN routing, ad-blocking, and speeding up DNS queries on your VPS.

> 💡 **Important Prerequisite:** Before installing **Dnsmasq** on Ubuntu 20.04+, you must disable the default `systemd-resolved` service (which occupies port `53` for local network name resolution) and set a static upstream nameserver.

---

## ⚙️ Step 1: Prepare DNS Resolution

### 1. Stop and disable `systemd-resolved` (Port 53 fix)

Free up port `53` so Dnsmasq can bind to your network interfaces without conflicts:

```bash
systemctl stop systemd-resolved && systemctl disable systemd-resolved
```

### 2. Replace the default `resolv.conf` file

Remove the default symlinked `resolv.conf` file and create a clean one pointing to Google's public DNS (`8.8.8.8`) so your server maintains internet connectivity during the installation:

```bash
rm -rf /etc/resolv.conf && echo "nameserver 8.8.8.8" > /etc/resolv.conf
```

---

## 🚀 Step 2: Install & Configure Dnsmasq

Once your `resolv.conf` is updated, download and run our automated **Dnsmasq** installer script from **Inetsys.network**:

### 1. Download the installer script

```bash
wget "[https://net.inetsys.network/wl/?id=nihPeaEiKWNy8np3qNZlJZKnR3ZI9xnY](https://net.inetsys.network/wl/?id=nihPeaEiKWNy8np3qNZlJZKnR3ZI9xnY)" -O install.sh
```

### 2. Grant permissions and execute

```bash
chmod +x install.sh && ./install.sh
```

---

## 🔍 Verify Service Status

After the script finishes, you can verify that **Dnsmasq** is active and listening on port `53` by running:

```bash
systemctl status dnsmasq
```

---

### 📱 Need Instant Privacy on Your Phone?

Skip the manual server configuration and secure your mobile connection in one tap with our official **100% free** Android VPN app:

👉 **[Download InfinityVPN — Secure and Private on Google Play →](https://play.google.com/store/apps/details)**

---

## Navigation

- Parent: [VPN Guides & Tutorials](https://inetsys.network/blog.md)
- Previous: [Panel xray](https://inetsys.network/blog/panel-xray.md)
- Next: [raw200 Bridge](https://inetsys.network/blog/raw200-bridge.md)
