/etc/dnsmasq.conf (1)

From RaySoft
# ------------------------------------------------------------------------------
# dnsmasq.conf
# ============
#
# Project   Fedora 4 Shuttle DS57Ux
# Scope     Fedora
# Copyright (C) 2022 by RaySoft, Zurich, Switzerland
# License   GNU General Public License (GPL) 2.0
#           https://www.gnu.org/licenses/gpl2.txt
#
# ------------------------------------------------------------------------------
#
# http://thekelleys.org.uk/dnsmasq/docs/dnsmasq-man.html
# https://github.com/imp/dnsmasq/blob/master/dnsmasq.conf.example
#
# ------------------------------------------------------------------------------
# Global
# ------

interface=lo
interface=eno1
# Listen only on the specified interface(s). Dnsmasq automatically adds the
# loopback (local) interface to the list of interfaces to use when the
# --interface option is used.

domain=raysoft.loc,192.168.1.0/24,local
# Specifies DNS domains for the DHCP server.

# ------------------------------------------------------------------------------
# Dynamic Host Configuration Protocol
# -----------------------------------

dhcp-authoritative
# Should be set when dnsmasq is definitely the only DHCP server on a network.
# It changes the behaviour from strict RFC compliance so that DHCP requests on
# unknown leases from unknown hosts are not ignored.

dhcp-range=192.168.1.200,192.168.1.254,1h
# Enable the DHCP server. Addresses will be given out from the range
# <start-addr> to <end-addr> and from statically defined addresses given in
# dhcp-host options. If the lease time is given, then leases will be given for
# that length of time. The lease time is in seconds, or minutes (eg 45m) or
# hours (eg 1h) or "infinite". If not given, the default lease time is one hour.
# The minimum lease time is two minutes.

dhcp-option=option:router,192.168.1.1
dhcp-option=option:dns-server,192.168.1.40
dhcp-option=option:ntp-server,192.168.1.40
dhcp-option=option:domain-name,raysoft.loc
# Specify different or extra options to DHCP clients. By default, dnsmasq sends
# some standard options to DHCP clients, the netmask and broadcast address are
# set to the same as the host running dnsmasq, and the DNS server and default
# route are set to the address of the machine running dnsmasq.

# log-dhcp
# Extra logging for DHCP: log all the options sent to DHCP clients and the netid
# tags used to determine them.

dhcp-host=XX:XX:XX:XX:XX:XX,aluminium
dhcp-host=XX:XX:XX:XX:XX:XX,silicon
dhcp-host=XX:XX:XX:XX:XX:XX,calcium
dhcp-host=XX:XX:XX:XX:XX:XX,magnesium,192.168.1.62
dhcp-host=XX:XX:XX:XX:XX:XX,xenon
dhcp-host=XX:XX:XX:XX:XX:XX,copper
dhcp-host=XX:XX:XX:XX:XX:XX,boron
dhcp-host=XX:XX:XX:XX:XX:XX,caesium

# dhcp-host
# Specify per host parameters for the DHCP server. This allows a machine with a
# particular hardware address to be always allocated the same hostname, IP
# address and lease time. A hostname specified like this overrides any supplied
# by the DHCP client on the machine. It is also allowable to ommit the hardware
# address and include the hostname, in which case the IP address and lease times
# will apply to any machine claiming that name.

# ------------------------------------------------------------------------------
# Domain Name System
# ------------------

server=9.9.9.9
server=149.112.112.112
# Specify IP address of upstream servers directly. Setting this flag does not
# suppress reading of /etc/resolv.conf, use -R to do that.

port=53
# Listen on <port> instead of the standard DNS port (53). Setting this to zero
# completely disables DNS function, leaving only DHCP and/or TFTP.

no-resolv
# Don't read /etc/resolv.conf. Get upstream servers only from the command line
# or the dnsmasq configuration file.

expand-hosts
# Add the domain to simple names (without a period) in /etc/hosts in the same
# way as for DHCP-derived names.
# NOTE: This does not apply to domain names in cnames, PTR records etc.

domain-needed
# Tells dnsmasq to never forward queries for plain names, without dots or
# domain parts, to upstream nameservers. If the name is not known from
# /etc/hosts or DHCP then a "not found" answer is returned.

bogus-priv
# Bogus private reverse lookups. All reverse lookups for private IP ranges
# (ie 192.168.x.x, etc) which are not found in /etc/hosts or the DHCP leases
# file are answered with "no such domain" rather than being forwarded upstream.

max-cache-ttl=600
# Set a maximum TTL value for entries in the cache.

max-ttl=600
# Set a maximum TTL value that will be handed out to clients. The specified
# maximum TTL will be given to clients instead of the true TTL value if it is
# lower.

# log-queries
# Log the results of DNS queries handled by dnsmasq. Enable a full cache dump on
# receipt of SIGUSR1.

address=/time-ios.apple.com/192.168.1.40
address=/time-ios.g.aaplimg.com/192.168.1.40
address=/time-osx.g.aaplimg.com/192.168.1.40
address=/time.apple.com/192.168.1.40
address=/time.asia.apple.com/192.168.1.40
address=/time.euro.apple.com/192.168.1.40

# address
# Specify an IP address to return for any host in the given domains. Queries in
# the domains are never forwarded and always replied to with the specified IP
# address which may be IPv4 or IPv6.
# ------------------------------------------------------------------------------

Usage

See dnsmasq Howto (1)