Skip to content

Commit 60e19ac

Browse files
swhite2Monviech
andauthored
dnsmasq: sync with current options and clarify their usage (opnsense#735)
* dnsmasq: sync with current options and clarify their usage * Update source/manual/dnsmasq.rst Co-authored-by: Monviech <[email protected]> * Update source/manual/dnsmasq.rst Co-authored-by: Monviech <[email protected]> --------- Co-authored-by: Monviech <[email protected]>
1 parent cad7815 commit 60e19ac

File tree

1 file changed

+28
-12
lines changed

1 file changed

+28
-12
lines changed

source/manual/dnsmasq.rst

Lines changed: 28 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -458,18 +458,28 @@ In our example, we configure query forwarding for 2 networks:
458458
thats not used on the internet, e.g., ``lan.internal.example.com``.
459459

460460

461-
Now that we have the DNS infrastructure set up, we can configure the DHCP ranges.
461+
Now that we have the DNS infrastructure set up, we can configure DHCP.
462462

463463
- Go to :menuselection:`Services --> Dnsmasq DNS & DHCP --> General` and set:
464464

465-
================================== =======================================================================================================
466-
Option Value
467-
================================== =======================================================================================================
468-
**Interface** ``LAN, GUEST`` (The network interfaces which will serve DHCP, this registers firewall rules)
469-
**DHCP fqdn** ``X``
470-
**DHCP default domain** ``internal`` (or leave empty to use this system's domain)
471-
**DHCP register firewall rules** ``X``
472-
================================== =======================================================================================================
465+
================================================ =======================================================================================================
466+
Option Value
467+
================================================ =======================================================================================================
468+
**Interface** ``LAN, GUEST`` (The network interfaces which will serve DHCP, this registers firewall rules)
469+
**Do not forward to system defined DNS servers** ``X`` (Unless Domains are specified in Dnsmasq: Domains, this will disable forwarding behavior)
470+
**DHCP fqdn** ``X``
471+
**DHCP default domain** ``internal`` (or leave empty to use this system's domain)
472+
**DHCP register firewall rules** ``X``
473+
================================================ =======================================================================================================
474+
475+
.. Note::
476+
477+
**DHCP fqdn** will do two things:
478+
479+
- Make sure all devices are registered in DNS with the configured domain name appended, e.g. ``smartphone.lan.internal``.
480+
This ensures that ``smartphone`` can exist in both ``lan.internal`` and ``guest.internal``.
481+
- Register the DHCP domain name as local, which will make Dnsmasq authoritative for this domain, ensuring ``NXDOMAIN`` is returned
482+
for devices querying unknown hostnames within this local domain.
473483

474484
- Press **Apply**
475485

@@ -554,12 +564,18 @@ Our smartphone now has the following IP configuration:
554564
- DNS Server: ``192.168.1.1``
555565

556566
At the same time, Dnsmasq registers the DNS hostname of the smartphone (if it exists). Since we configured the FQDN option and domain in the DHCP range, the name of the
557-
smartphone will be: ``smartphone.lan.internal``.
567+
smartphone will be: ``smartphone.lan.internal.``.
558568

559-
When a client queries `Unbound` for exactly ``smartphone.lan.internal``, the configured query forwarding sends the request to the DNS server responsible for ``lan.internal``
560-
which is our configured `Dnsmasq` listening on ``127.0.0.1:53053``. ``Dnsmasq`` responds to this query and will resolve the current A-Record of ``smartphone.lan.internal`` to
569+
When a client queries `Unbound` for exactly ``smartphone.lan.internal.``, the configured query forwarding sends the request to the DNS server responsible for ``lan.internal.``
570+
which is our configured `Dnsmasq` listening on ``127.0.0.1:53053``. ``Dnsmasq`` responds to this query and will resolve the current A record of ``smartphone.lan.internal.`` to
561571
``192.168.1.100``, sending this information to `Unbound` which in return sends the response back to the client that initially queried.
562572

573+
.. Tip::
574+
575+
You can usually resolve a hostname in your network by querying for e.g. ``smartphone``. This works because client systems
576+
recognize that a FQDN is not used, and will therefore suffix the request with their domain name received from Dnsmasq, transforming
577+
the query to ``smartphone.lan.internal.``.
578+
563579
As you can see, this is a highly integrated and simple setup which leverages just the available DHCP and DNS standards with no trickery involved.
564580

565581

0 commit comments

Comments
 (0)