Edit dnsmasq Settings
ServBay comes with a dnsmasq service and offers flexible configuration options. This document provides a detailed guide on how to modify dnsmasq settings in ServBay, including the location of the dnsmasq.conf
file and common configuration items.
Overview
In ServBay, the dnsmasq configuration file is located in the /Applications/ServBay/etc/dnsmasq
directory. Here are the details of the configuration files:
dnsmasq.conf
:/Applications/ServBay/etc/dnsmasq/dnsmasq.conf
domains.conf
:/Applications/ServBay/etc/dnsmasq/domains.conf
dnsmasq.conf Configuration
The dnsmasq.conf
file is the main configuration file for dnsmasq, used to set various DNS and DHCP options.
Common Configuration Items
Below are some common dnsmasq.conf
configuration items and how to modify them:
Setting DNS Servers:
server=8.8.8.8 server=8.8.4.4
1
2Setting Cache Size:
cache-size=1000
1Setting Domain Name:
domain=local
1Enable DNS Query Logs:
log-queries
1Setting DHCP Range:
dhcp-range=192.168.0.50,192.168.0.150,12h
1
Custom DNS Records
dnsmasq allows you to customize DNS records, which is very useful for small networks or development environments. The configuration file is located at domains.conf
STOP
domains.conf
will be automatically overwritten by ServBay. Please use ServBay's Manage Local DNS Service for modifications.
Example Configuration
Below are examples of custom DNS records:
- Setting Local Hostname Resolution:
address=/servbay.host/127.0.0.1
1
Restarting dnsmasq
After modifying the dnsmasq configuration file, the service needs to be restarted for the changes to take effect. This can be done via the ServBay management interface or using the command-line tool servbayctl
.
Restart via ServBay Management Interface
- Open the ServBay management interface.
- Navigate to
Services
. - Find the dnsmasq service and click the
Restart
button.
Restart via servbayctl
Using the command-line tool servbayctl
, you can easily restart the dnsmasq service:
servbayctl restart dnsmasq -all
Summary
In ServBay, the dnsmasq configuration files are located in the /Applications/ServBay/etc/dnsmasq
directory. By modifying these files, you can set DNS servers, cache size, domain name, enable logs, and configure the DHCP range. Custom DNS records can also be configured through these files. After making these changes, you can restart the dnsmasq service via the ServBay management interface or using the servbayctl
command-line tool to apply the changes.