Preventing dnsmasq from Creating AAAA Records for Hosts using DHCPv6 in Dual-Stack Networks

Abstract: Stop dnsmasq from creating AAAA records for DHCPv6 clients by disabling DHCPv6 with the no-dhcp6 flag.

Created: 2026-10-03 by

To prevent dnsmasq from creating AAAA records for DHCPv6 clients, you must disable the DHCPv6 service entirely using --no-dhcp6 or by omitting it from configuration. Since dnsmasq only generates DNS entries for leases it manages, removing DHCPv6 stops it from associating IPv6 addresses with hostnames. For networks requiring both IPv4 and IPv6, rely on static host-record directives for specific devices or use a separate authoritative DNS server for dynamic IPv6 records.

Understanding the Root Cause

The core issue stems from how dnsmasq handles dynamic host registration. When dnsmasq is configured to provide DHCPv6 services (either via stateful DHCPv6 or as part of a mixed configuration), it receives lease information from clients. By default, if a client requests a hostname or if the server has a mapping, dnsmasq will automatically create an A record for IPv4 and an AAAA record for IPv6 in its internal cache and on disk (if dhcp-hostsfile is used). Many administrators assume that tweaking DNS options can suppress just the AAAA record while keeping the DHCPv6 lease active. However, there is no native flag in dnsmasq to "suppress AAAA but keep DHCPv6." The architecture couples the lease management with the DNS generation. If you want dynamic IPv6 addressing for your clients but do not want those addresses reflected in your local DNS zone managed by dnsmasq, you have two primary architectural choices: 1. Remove DHCPv6 from dnsmasq entirely and let another daemon handle IPv6 leasing. 2. Keep DHCPv6 in dnsmasq but explicitly override the DNS behavior for specific hosts using static mappings, though this does not scale well for large dynamic pools. For most dual-stack home or small office networks, the cleanest solution is to offload IPv6 address assignment to a different service, such as radvd (for SLAAC) or dhcpd (from ISC), while letting dnsmasq focus on IPv4 DHCP and DNS.

Disabling DHCPv6 in dnsmasq

The most direct way to stop dnsmasq from creating AAAA records for dynamically assigned IPv6 addresses is to ensure it is not listening for or managing DHCPv6 traffic. This is achieved by disabling the DHCPv6 functionality in the configuration file. In your /etc/dnsmasq.conf (or included files), look for lines related to DHCPv6. Common configurations might include:
# Example of what might currently be present
dhcp-range=::,constructor:eth0,ra-only
# Or stateful DHCPv6
dhcp-range=2001:db8::10,static,64m
To disable DHCPv6 completely, add the following option:
no-dhcp6
Alternatively, if you are starting dnsmasq via command line arguments, ensure you do not pass any flags that enable DHCPv6, such as --enable-ra combined with DHCPv6 ranges, although --enable-ra alone is often acceptable if you only need Router Advertisements without managing leases. However, note that even with ra-only, if dnsmasq is acting as a DHCPv6 server for other reasons, it may still attempt to register hosts. The no-dhcp6 flag is the definitive switch to turn off all DHCPv6 processing. After making this change, restart the dnsmasq service:
sudo systemctl restart dnsmasq
Clients will still receive IPv6 addresses through SLAAC (Stateless Address Autoconfiguration) provided that Router Advertisements are sent by your router or firewall. However, dnsmasq will no longer maintain a lease database for these IPv6 addresses, and consequently, it will not generate AAAA records for them.

Handling IPv4-Only Hostnames

With DHCPv6 disabled, your network remains fully functional for IPv4 communications. Clients will obtain IPv4 addresses via standard DHCP, and dnsmasq will continue to create A records for them as expected. This ensures that tools relying on reverse DNS or forward lookups for local resources continue to work for IPv4 hosts. If you have critical servers that require both IPv4 and IPv6 addresses to be resolvable by name, you must handle the IPv6 side differently. Since dnsmasq is no longer tracking their dynamic IPv6 leases, you have two options: 1. Static Entries: Use the host-record option in dnsmasq to manually map a hostname to a specific IPv6 address. This is suitable for servers with stable IPv6 prefixes.
host-record=server.example.com,[2001:db8::10]
    
2. External DNS: Delegate the AAAA records for dynamic hosts to an external authoritative DNS provider that supports dynamic updates (DDNS) from your ISP or a cloud provider like Cloudflare.

Using Radvd for SLAAC

Since dnsmasq is no longer providing DHCPv6, you should ensure your network still provides IPv6 connectivity via SLAAC. This is typically handled by radvd (Router Advertisement Daemon). Install and configure radvd to advertise the IPv6 prefix on your interface:
interface eth0 {
    AdvSendAdvert on;
    MinRtrAdvInterval 3;
    MaxRtrAdvInterval 10;
    prefix 2001:db8::/64 {
        AdvOnLink on;
        AdvAutonomous on;
        AdvValidLifetime 86400;
    };
};
This allows clients to self-assign IPv6 addresses without needing a DHCPv6 server. They will not appear in dnsmasq's DNS records, which is exactly the desired outcome for this scenario.

Verifying the Configuration

After applying these changes, verify that AAAA records are no longer being created for DHCPv6 clients. You can check the dnsmasq cache using the dnsmasq --cache-size=0 diagnostic mode or by querying the local DNS directly.
dig @localhost AAAA client-hostname.localdomain
If the configuration is correct, this query should return NXDOMAIN or NOERROR with no AAAA record for clients that were previously registered via DHCPv6. Conversely, IPv4 clients should still resolve correctly:
dig @localhost A client-hostname.localdomain
This confirms that dnsmasq is handling IPv4 leases and DNS normally while ignoring IPv6 dynamic assignments.

Common Pitfalls

Be aware that some distributions package dnsmasq with DHCPv6 enabled by default. Always audit your configuration files after updates. Additionally, if you are using systemd-networkd or NetworkManager, they may attempt to configure dnsmasq settings dynamically. Ensure that your static dnsmasq.conf overrides any auto-generated settings. Another common mistake is assuming that ra-only disables DHCPv6 lease management. While ra-only tells dnsmasq not to assign IP addresses via DHCPv6, it does not necessarily prevent it from interacting with the DNS subsystem in complex setups where other components inject data. The no-dhcp6 flag is the safest and most comprehensive method to sever the link between IPv6 leasing and DNS generation.

Frequently Asked Questions

Will disabling DHCPv6 break IPv6 connectivity?

No, disabling DHCPv6 in dnsmasq does not break IPv6 connectivity. Clients will still receive IPv6 addresses via SLAAC (Stateless Address Autoconfiguration) if your router sends Router Advertisements. You simply lose the ability for dnsmasq to manage IPv6 leases and generate corresponding DNS records.

How do I make specific servers resolvable via IPv6 if DHCPv6 is off?

You must use static DNS entries. Add host-record=hostname,[ipv6-address] to your dnsmasq configuration for each server that needs an AAAA record. This bypasses the dynamic lease mechanism and manually maps the name to the address.

Can I use dhcpcd or isc-dhcp-server instead for IPv6?

Yes. If you need dynamic IPv6 address assignment and DNS integration, consider using isc-dhcp-server for IPv6. It can be configured to send DDNS updates to a separate BIND or PowerDNS server, keeping dnsmasq focused solely on IPv4 and caching.

Why are AAAA records still appearing after adding no-dhcp6?

Ensure that no other process is injecting AAAA records into dnsmasq. Also, check if you are using --enable-ra alongside other DHCPv6 parameters. The no-dhcp6 flag must be the sole directive regarding DHCPv6 status. Clear the cache with systemctl restart dnsmasq to remove stale entries.

Does this affect IPv6-only clients?

If a client is IPv6-only and relies entirely on DHCPv6 for address assignment, disabling DHCPv6 in dnsmasq will leave it without an IP address unless SLAAC is properly configured by another router. Ensure your network infrastructure provides Router Advertisements for SLAAC to function correctly for IPv6-only devices.

Latest News

How to Display Output of xterm Command in Terminal Screen using Cron

Resolve the inability to display xterm output in a terminal screen from cron by redirecting logs or using wall instead of insecure X11 workarounds.

Read More
Expose Local Server on VPS Preserving Real Client IPs (OS Level)

Resolve VPS logging showing only gateway IPs by configuring reverse proxies to forward real client addresses via X-Forwarded-For headers.

Read More
How to Clear Recent Files History in Linux without Deleting Actual Files?

Clear recent files history in Linux by deleting ~/.local/share/recently-used.xbel without removing the actual files.

Read More
Best HDD Copy Strategy: Manually Syncing and Rewriting Scratch

Resolve data drift between two 4TB hard drives by using rsync with the --delete flag to manually sync and rewrite scratch data for an exact mirror.

Read More
Understanding Bash Prompt Abbreviations: An Overview

Resolve repetitive typing errors by creating and persisting Bash aliases in the .bashrc file for improved command-line efficiency.

Read More
Free Tools and Methods to Log Real-Time Performance Details in Task Manager

Log real-time CPU and memory metrics to CSV files using Windows Performance Monitor Data Collector Sets to troubleshoot system slowness.

Read More
Contact Qatar Airways Customer Service: Phone Number, Help Center, and More

Resolve urgent Qatar Airways reservation issues like flight changes and baggage claims using the US phone number +1801-855-5905 or online self-service tools.

Read More
Windows 11: Alt Codes Displaying Wrong Characters - Solutions

Resolve Windows 11 Alt codes showing wrong characters by verifying the US keyboard layout and enabling Num Lock.

Read More
Run Programs with Elevated Privileges: A Comprehensive Guide

Eliminates the need to type sudo for frequent administrative tasks by configuring .bashrc aliases or functions.

Read More
Dynamically Changing Dates in Excel Formulas Using Cells

Eliminate manual date updates in Excel by using cell references to create dynamic formulas that automatically adjust calculations when input dates change.

Read More
Granting Edit Access to a Specific Excel Sheet in an Office 365 User Email ID-Based Login

Excel Online lacks native sheet-level permissions, so users must split workbooks or use worksheet protection to isolate edit access for specific tabs.

Read More
Creating Network Load on Local Wi-Fi from One PC

Generate sustained Wi-Fi bandwidth load from a single PC using a VM SFTP server to test router stability and throughput.

Read More
Changing the Default Editor for Batch Files in Windows 11's File Explorer

Resolve the issue of batch files opening in Notepad by changing the default editor to a preferred application like VS Code.

Read More
Gain WiFi Connection Minutes Before Losing it by Changing MAC Address

Bypass MAC address filtering to restore WiFi connectivity temporarily when a device is blocked by network administrators.

Read More
Photos Folders Turned Black: Troubleshooting Picture Applications on Windows

Resolve black screens in Windows Photos by resetting the app, updating graphics drivers, and repairing system files.

Read More
Troubleshooting High CPU Temperature Values: A Step-by-Step Guide

Resolve high CPU temperatures and thermal throttling by monitoring with Speedfan, cleaning dust from cooling components, and replacing degraded thermal paste.

Read More
Make cURL establish TLS connection with CA unknown

Resolve cURL TLS connection failures with unknown or self-signed certificates by using the --insecure flag to bypass CA validation.

Read More
Troubleshooting Incorrect Network Metrics Values in Grafana, Prometheus, InfluxDB, and Telegraf

Fix incorrect network metrics in Grafana, Prometheus, InfluxDB, and Telegraf by verifying interface selection, resolving unit mismatches, and handling counter resets.

Read More
Start Another Terminal Window (cmd.exe) Windows Repair/Troubleshoot

Provides step-by-step instructions to access the Windows Command Prompt via bootable media for advanced system repair and troubleshooting.

Read More
Thinkpad P1 Gen 6: Sudden Thunderbolt 3 Dock USB-C Charging Stopped Working

Resolve sudden Thunderbolt 3 dock USB-C charging and internet failure on ThinkPad P1 Gen 6 by updating firmware, resetting the dock, and adjusting power settings.

Read More
ASUS Windows 11 Laptop: Internet Connection Issue with Hotspot

Resolve ASUS Windows 11 laptop spinning wheel issue when connecting to mobile hotspot by resetting network stack, disabling IPv6, and adjusting power settings.

Read More
Developing iOS Project with Firebase: Logging in and Sending Push Notifications

Integrates Firebase to enable secure user authentication and push notifications in iOS applications.

Read More
Troubleshooting Bash Script with Suspected Issues of Spaces, Dashes, Filenames and Quoting

Resolve Bash script failures caused by word splitting, globbing, and special characters in filenames by applying proper quoting techniques.

Read More
Populating OneDrive Folder for Local Backup without Affecting Remote Files

Prevent OneDrive from deleting remote files during Windows reinstallation by unlinking the account or using symbolic links to isolate local data.

Read More
Force First Frame as Keyframe Without Re-encoding: A Quick Solution

Resolve inaccurate seeking and playback glitches by re-encoding video to ensure the first frame is a valid keyframe.

Read More
Find Information in Database Using WSL (Ubuntu) on Windows-10

Resolve database connection issues from WSL Ubuntu on Windows 10 by configuring client tools and network access to query remote or local servers.

Read More
Configuring a New Router with Different Networks: One Family, One Guest

Resolve IP conflicts and isolate guest traffic by configuring a second router with a distinct subnet via its WAN port.

Read More
Quickly Open Multiple Stock Websites with a Single Command

Solve the problem of manually opening multiple stock research websites by creating a single command to launch them simultaneously on Windows, macOS, or Linux.

Read More
Improved Adobe Acrobat Search Experience: Access Advanced Search with Ease

Access advanced search filters like case sensitivity and regex in Adobe Acrobat by clicking More Options in the Find bar.

Read More
Port Forwarding VM via OpenVPN: A Comprehensive Guide

Configure OpenVPN server and iptables to forward specific ports from VPN clients to a virtual machine's internal IP address.

Read More
Understanding Partitions in the 1980s: A Look Back at MS-DOS and Master Boot Record

Explains how the Master Boot Record and partition table enabled MS-DOS to manage multiple disk volumes on a single physical drive.

Read More
Windows 10 Enterprise: Keyboard Not Detected in Managed Organization with Admin Privileges

Resolve Windows 10 Enterprise keyboard detection failures caused by Group Policy restrictions, driver corruption, or USB enumeration errors.

Read More
Can't Find x86_64 Versions of Applications on MacOS arm64 (M1)

Resolve missing x86_64 app issues on M1 Macs by installing Rosetta 2 and reinstalling apps as universal binaries.

Read More
How to Hide Installation Source for an Android App

Manage Android app installation source visibility by using USB transfers or file managers to reduce browser traces and isolate data via work profiles.

Read More
Connecting Momentus 4200.2 ST9808210A Hard Drive via USB Cable

Resolve inability to access Seagate Momentus 4200.2 ST9808210A hard drive by connecting it via USB using a compatible SATA-to-USB adapter and configuring the disk in Windows.

Read More