Skip to content

Linux VPS & VPS Windows Setup Guide | NetCloud24 a Local DNS Resolver with Dnsmasq on Rocky Linux

Cloud Infrastructure Expert
Linux VPS & VPS Windows Setup Guide | NetCloud24 a Local DNS Resolver with Dnsmasq on Rocky Linux

Introduction

Dnsmasq is a lightweight DNS forwarder and DHCP server. This tutorial will guide you through the process of installing and configuring Dnsmasq as a local DNS resolver on Rocky Linux.

Prerequisites

Before you begin, ensure you have:

  1. A Rocky Linux system
  2. Root or sudo privileges

Step 1: Install Dnsmasq

Install Dnsmasq using the following command:

sudo dnf install -y dnsmasq

Step 2: Configure Dnsmasq

Edit the Dnsmasq configuration file:

sudo nano /etc/dnsmasq.conf

Add the following configuration to the file:

listen-address=127.0.0.1
bind-interfaces
domain-needed
bogus-priv
no-resolv
server=8.8.8.8
server=8.8.4.4

Save and close the file.

Step 3: Restart Dnsmasq

Restart the Dnsmasq service to apply the changes:

sudo systemctl restart dnsmasq

Step 4: Test DNS Resolution

Test DNS resolution using the nslookup command:

nslookup example.com

Step 5: Configure Network Settings

Update the network settings on your system to use the local DNS resolver. Edit the network configuration file:

sudo nano /etc/sysconfig/network-scripts/ifcfg-eth0

Add the following line to the file:

DNS1=127.0.0.1

Save and close the file. Restart the network service:

sudo systemctl restart NetworkManager

Conclusion

Congratulations! You have successfully installed a local DNS resolver with Dnsmasq on Rocky Linux. Your system is now configured to use Dnsmasq for DNS resolution.

Windows VPS Deutschland

Windows VPS España

Windows VPS Nederland

Windows VPS Italia

Windows VPS Portugal

VPS Windows Italia

Windows VPS

Windows VPS

Windows VPS Sverige

Windows VPS Norge

Windows VPS

Windows VPS Türkiye

Windows RDS (Remote Desktop Services)

Windows VPS

Explore more

More on this topic

Netcloud24
Netcloud24
Cloud Infrastructure Expert · NetCloud24

Comments are closed.