Video transcript: NetCloud24 Expert Guides. Practical knowledge for a reliable cloud.
Cloud and VPS expertise, security, performance, and step-by-step tutorials.
Learn, deploy, and keep building with NetCloud24.
Prerequisites
Before you begin, ensure you have:
A Debian 12 system
Root or sudo privileges
Step 1: Install Dnsmasq
Install Dnsmasq using the following command:
sudo apt update
sudo apt install -y dnsmasq
Step 2: Configure Dnsmasq
Edit the Dnsmasq configuration file:
sudo nano /etc/dnsmasq.conf
Add the following configuration to the file to specify the DNS server and domain:
server=8.8.8.8
domain=local
You can replace “8.8.8.8” with the IP address of your preferred DNS server.
Step 3: Add Local DNS Entries
Edit the hosts file to add local DNS entries:
sudo nano /etc/hosts
Add entries for your local hosts in the following format:
Replace the IP addresses and hostnames with your own values.
Visual overview: How to Set Up Local DNS with Dnsmasq on Debian 12
Step 4: Restart Dnsmasq
Restart the Dnsmasq service to apply the changes:
sudo systemctl restart dnsmasq
Step 5: Test DNS Resolution
Test DNS resolution by pinging a local hostname:
ping server1.local
You should see successful ping responses.
Conclusion
Congratulations! You have successfully set up local DNS with Dnsmasq on Debian 12. You can now use local hostnames to access devices and services on your network.
Łukasz Bodziony is the CEO and founder of NETCLOUD24, a global VPS hosting brand proudly originating from Poland. With extensive experience in cloud computing, virtualization, and server management, he delivers high-performance Windows VPS and Remote Desktop Services (RDS) solutions to clients across Europe, North America, and beyond.
His expertise covers a wide range of technologies, including Microsoft Azure, Proxmox VE, Amazon Web Services (AWS), and numerous other virtualization and cloud platforms.
Beyond running his hosting business, Łukasz also provides professional paid server configuration and optimization services for companies and individuals. Outside of work, he is dedicated to caring for his children and building a secure future for them.
If you are interested in working with him or need expert assistance with your hosting, cloud environment, or server setup, feel free to reach out via Windows VPS.