DEV Community

Nucu Labs
Nucu Labs

Posted on • Edited on

3 1

Setting up a simple DNS server

Right after I’ve configured the FTP server, I wanted to be able to “name” my server and so I’ve installed a lightweight DNS server.

“dnsmasq is a lightweight DNS, TFTP, PXE, router advertisement and DHCP server. It is intended to provide coupled DNS and DHCP service to a LAN.”

I’ve chosen this over the bind 9 dns server because it was very easy to setup, I almost got it right the first time.

To install and configure dnsmasq, you’d usually do the following:

# On Ubuntu
sudo apt-get install dnsmasq
sudo cp /etc/dnsmasq.conf /etc/dnsmasq.conf.orig
Enter fullscreen mode Exit fullscreen mode

And override /etc/dnsmasq.conf with this configuration:

#/etc/dnsmasq.conf
domain-needed
bogus-priv

expand-hosts

# The address 192.168.0.176 is the static IP of this server 
# You can find this ip by running ifconfig and look for the 
# IP of the interface which is connected to the router.
listen-address=127.0.0.1
listen-address=192.168.0.176
bind-interfaces

# Use open source DNS servers
server=8.8.8.8
server=8.8.4.4
server=208.67.220.220

# Create custom 'domains'.
# Custom 'domains' can also be added in /etc/hosts
address=/busyserver.net/192.168.0.176
Enter fullscreen mode Exit fullscreen mode

And that’s basically it.

You can check the status of dnsmasq server by running: sudo systemctl status dnsmasq.

To actually use the server and make your computer recognize your custom domains you need to tell your computers to use the IP of the server on which dnsmasq is installed, in my case it is 192.168.0.176.

Thank you for reading!

Twitter | DORefferal

Image of Docusign

🛠️ Bring your solution into Docusign. Reach over 1.6M customers.

Docusign is now extensible. Overcome challenges with disconnected products and inaccessible data by bringing your solutions into Docusign and publishing to 1.6M customers in the App Center.

Learn more

Top comments (1)

Collapse
 
ibrahimfromtgddev profile image
Ibrahim Imran

Cool! I've been searching this on Google I guess I can only find it on Dev!

Billboard image

The Next Generation Developer Platform

Coherence is the first Platform-as-a-Service you can control. Unlike "black-box" platforms that are opinionated about the infra you can deploy, Coherence is powered by CNC, the open-source IaC framework, which offers limitless customization.

Learn more