Troubleshooting DNS Wildcard Domains: github.com Case Study

Abstract: Resolve unexpected wildcard DNS results for github.com by fixing local cache poisoning and correcting BIND9 forwarder configuration.

Created: 2026-10-23 by

When nslookup and curl return unexpected wildcard results for github.com, the issue usually stems from local DNS cache poisoning, misconfigured forwarders in BIND9, or an incorrect upstream resolver chain. This article details how to diagnose these specific failures using standard Linux tools and correct BIND9 configuration practices without relying on invalid system commands.

Understanding the Wildcard Anomaly

A wildcard DNS record is a valid configuration where a single record matches multiple subdomains using an asterisk (*). However, when you query a root domain like github.com and receive a response that looks like a wildcard match (e.g., resolving to an IP associated with *.github.com), it indicates a resolution path error. The client is not querying the authoritative servers correctly, or an intermediate server is intercepting the request. This behavior often manifests as curl failing to connect because the IP address returned does not correspond to the actual service endpoint. Simultaneously, nslookup might show the origin of the answer as a local resolver rather than a.root-servers.net or GitHub’s authoritative nameservers. This discrepancy is the primary symptom of a broken upstream forwarding chain or a local caching daemon returning stale or poisoned data. To verify if this is a global issue or local to your machine, you must isolate the resolution path. If other devices on the same network resolve github.com correctly, the problem is confined to your local DNS stack. If all devices fail, the issue lies within your network’s authoritative DNS server, likely a BIND9 instance misconfigured to handle upstream queries incorrectly.

Distinguishing Local vs. Network-Wide Failures

The first step in troubleshooting is determining the scope. Use dig @8.8.8.8 github.com to bypass local resolvers entirely. If this command returns the correct A and AAAA records for GitHub, your local configuration is at fault. If it also fails or returns weird wildcard data, your internet connection or ISP DNS might be interfering, though this is rare for major domains. For network-wide issues, inspect your BIND9 server. A common mistake is configuring BIND9 to use /etc/resolv.conf directly for upstream lookups. As noted in previous corrections, BIND9 does not read /etc/resolv.conf for upstream servers; it uses the forwarders directive within its own configuration files. If your BIND9 setup attempts to parse /etc/resolv.conf via a symlink or an invalid include, it may fail to find valid upstream servers, causing it to fall back to recursive resolution that gets intercepted by wildcard catches-all zones.

Correcting BIND9 Forwarder Configuration

If you are running BIND9 as your local DNS authority, you must ensure it forwards queries for external domains to reliable public resolvers like Google DNS or Cloudflare. The configuration should reside in /etc/bind/named.conf.options or a similar included file. You need to define the forwarders block explicitly. For example:
options {
    directory "/var/cache/bind";
    
    // Forward unresolved queries to Google DNS
    forwarders {
        8.8.8.8;
        8.8.4.4;
    };
    
    // Disable recursion if this is a caching-only server, 
    // or enable it carefully if acting as a full resolver
    recursion yes;
    allow-query { localhost; };
};
After modifying the configuration, always check for syntax errors using named-checkconf. If the syntax is valid, reload the service. Do not rely on systemd-resolved commands to flush BIND9 caches, as they operate on different daemons. Instead, use the BIND9-specific tool rndc to clear the cache.

Clearing the BIND9 Cache Properly

Stale wildcard records can persist in the BIND9 cache if a previous erroneous response was cached. To force BIND9 to forget these entries, use the following command:
sudo rndc flush
This command clears all cached data from the BIND9 process. After flushing, test the resolution again with nslookup github.com. The answer section should now reflect the current authoritative IPs for GitHub. If the issue persists, check if you have accidentally defined a catch-all zone (like zone "." IN { type master; file "/dev/null"; };) which might be intercepting queries before they reach the forwarders.

Diagnosing Local Resolver Issues

On modern Linux distributions using systemd, the local stub resolver is managed by systemd-resolved. A frequent error in troubleshooting guides is suggesting systemd-resolve --flush-caches, which is invalid. The correct command uses the resolvectl utility. If your local machine is experiencing the wildcard issue while the network is fine, you likely have a corrupted cache in systemd-resolved. Flush this cache using:
sudo resolvectl flush-caches
This ensures that any locally cached incorrect responses for github.com are discarded. Additionally, verify that your /etc/resolv.conf points to 127.0.0.53 (the systemd-resolved stub) rather than pointing directly to an external IP or a broken local service. Misconfigurations here can cause applications like curl to bypass the system resolver and hit dead ends. For users in WSL environments, DNS issues can also stem from the host OS leaking settings incorrectly. If you are on WSL 1, consider reviewing related guides on Curl Error (6): Couldn't Resolve Hostname - DNS Resolving Issue in WSL 1 to ensure your environment variables are correctly passing DNS information from the Windows host to the Linux guest.

Verifying Resolution with Dig

Once you have cleared caches and verified configurations, use dig for detailed diagnostics. Unlike nslookup, dig shows the full query/response cycle, including flags and additional sections. Run dig +trace github.com. This command traces the resolution path from the root hints down to the authoritative server. You should see a chain of queries hitting root servers, then TLD servers, and finally GitHub’s authoritative nameservers. If the trace stops early or redirects to a local IP unexpectedly, you have identified the point of failure in your forwarding chain. Check the ANSWER SECTION in the final response. It should contain A and AAAA records matching GitHub’s infrastructure. If it contains a CNAME pointing to a wildcard pattern that doesn’t expand correctly, your local resolver might be mishandling CNAME chains. Ensure that your BIND9 configuration allows proper CNAME flattening or follows referrals correctly.

Preventing Future Wildcard Interceptions

To prevent recurrence, audit your DNS zone files. Ensure no accidental wildcard entries exist for top-level domains. In BIND9, avoid using *.example.com unless absolutely necessary for dynamic DNS updates. Furthermore, monitor your logs for repeated SERVFAIL or REFUSED responses, which indicate clients are hitting blocks or misconfigurations. Regularly update your BIND9 software to patch security vulnerabilities that could be exploited for DNS spoofing. Keep your upstream forwarders updated as well. If you are migrating away from BIND9, consider reviewing migration strategies such as those found in Migrating from Bind9 to PowerDNS: Forwarders Setup Guide to ensure robust forwarder handling in alternative systems.

Frequently Asked Questions

Why does nslookup show a different IP than dig?

nslookup often uses the default system resolver and may display cached results, whereas dig allows you to specify exact servers and flags. Always use dig for accurate diagnostics because it reveals the full query path and avoids local cache interference by default.

Can I use /etc/resolv.conf to configure BIND9 forwarders?

No, BIND9 does not read /etc/resolv.conf for upstream server configuration. You must define forwarders explicitly in the named.conf.options file using the forwarders directive. Using /etc/resolv.conf only affects how the host resolves names, not how BIND9 forwards them.

What is the correct command to flush systemd-resolved cache?

The correct command is sudo resolvectl flush-caches. The older systemd-resolve command is deprecated and does not support the --flush-caches flag in most modern distributions. Using the wrong command will result in a "command not found" or invalid option error.

How do I know if my BIND9 server is catching all queries?

Check your zone definitions for a catch-all entry like zone "." IN { type master; ... }; or wildcard records in active zones. Use named-checkconf to validate your configuration and review /var/log/syslog for queries being handled by unexpected zones instead of forwarded.

Is it safe to disable recursion in BIND9?

Disabling recursion is safe if BIND9 is configured strictly as a caching server with valid forwarders. However, if clients rely on BIND9 for recursive resolution of internal domains, disabling it will break their ability to resolve non-forwarded hosts. Test thoroughly after making changes to the recursion option.

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