Problems accessing home network web pages - Router DNS issue?

Abstract: Resolve LAN access failures to local web pages by fixing UFW firewall rules, DHCP issues, or router isolation settings.

Created: 2026-10-22 by
Local network web pages failing to load while localhost works typically indicates a DNS resolution failure or a firewall rule blocking external interface access rather than the Apache service itself. The server is reachable via its loopback address, confirming the web server software is running correctly. However, other devices on the LAN cannot resolve the hostname or connect to the specific IP address assigned to the Raspberry Pi. This disconnect usually stems from misconfigured DHCP options, incorrect /etc/hosts entries, or UFW rules that restrict traffic to non-loopback interfaces.

Verifying Network Connectivity and Interface Status

Before diving into complex configurations, you must ensure the Raspberry Pi has a valid IP address on the local subnet. Use ip addr show to list all network interfaces. Identify the interface connected to your router (often eth0 for wired or wlan0 for wireless). Check if the IP address falls within the same subnet as your client machine. If the IP is 169.254.x.x, the device failed to obtain an address via DHCP and is using a link-local address, which prevents communication with other LAN devices. If the interface shows a valid IP, verify that it is not isolated by router settings. Some routers have "AP Isolation" or "Client Isolation" enabled, which prevents devices on the same Wi-Fi network from communicating with each other. Disable this feature in your router’s admin panel if it is active. Additionally, ping the default gateway from the Raspberry Pi using ping -c 4 192.168.1.1 (replace with your actual gateway). If this fails, the issue is physical connectivity or switch/router configuration, not the web server.

Checking Firewall Rules with UFW

Ubuntu servers often come with the Uncomplicated Firewall (UFW) enabled. By default, UFW may deny incoming connections on public interfaces while allowing them on loopback. Since accessing via localhost uses the loopback interface (lo), it bypasses these restrictions. Accessing via the LAN IP triggers the firewall rules for the external interface. Run sudo ufw status verbose to inspect current rules. Look for lines that explicitly deny incoming traffic or allow only specific ports like SSH (22/tcp) but omit HTTP (80/tcp) or HTTPS (443/tcp). If you see a rule denying incoming traffic, you must allow web traffic. Execute sudo ufw allow http and sudo ufw allow https. If you are using a non-standard port, replace http with allow 8080/tcp or your specific port number. After updating the rules, test access from another device on the network. If the problem persists, check if a more specific deny rule exists above the allow rule, as UFW processes rules in order. For deeper insight into how Ubuntu handles these interfaces, you might find How do Ubuntu-server network interfaces work? helpful for understanding the underlying network stack behavior.

Testing Localhost vs. LAN IP Behavior

To confirm the firewall hypothesis, compare responses from different addresses. From the Raspberry Pi itself, run curl -I http://localhost. This should return a 200 OK header. Next, determine the LAN IP using hostname -I and run curl -I http://. If the second command hangs or times out while the first succeeds, the firewall is definitely blocking external requests. Ensure that your Apache configuration listens on 0.0.0.0 or the specific LAN IP, not just 127.0.0.1. In /etc/apache2/ports.conf, verify that the Listen directive does not restrict binding to localhost only.

DNS Resolution and Hostname Configuration

If you are accessing the site by hostname (e.g., http://raspberrypi.local) rather than IP, DNS issues are likely the culprit. Linux systems use mDNS for .local domains. Ensure the avahi-daemon is installed and running on the Raspberry Pi with sudo systemctl status avahi-daemon. On the client machine, ensure it supports mDNS resolution. Windows users may need the Bonjour Print Services or rely on NetBIOS names instead. Alternatively, configure static DNS entries on your router’s DHCP server. Many routers allow you to assign a static lease and define a custom hostname for the DHCP reservation. This ensures that when the client requests the name, the router returns the correct IP. If you prefer manual configuration, edit /etc/hosts on the client machine to include the Raspberry Pi’s IP and hostname. This bypasses DNS entirely for testing purposes. If direct IP access works but hostname access fails, the issue is strictly DNS-related, not a web server or firewall problem.

Apache Virtual Host and Binding Issues

Sometimes Apache is configured to serve content only for specific virtual hosts bound to certain IPs. Check the sites-enabled directory in /etc/apache2/sites-available/. Open the default configuration file and look for the <VirtualHost> tag. It should contain <VirtualHost *:80> or <VirtualHost _default_:80>. If it specifies a particular IP address that differs from the one assigned to the interface, external requests will be rejected. Additionally, verify that the ServerName directive matches the hostname you are trying to access. While not strictly required for basic access, mismatches can cause redirect loops or 403 errors depending on the configuration. Restart Apache after any changes using sudo systemctl restart apache2. Monitor the error logs in /var/log/apache2/error.log for clues regarding permission denied or binding failures. For users dealing with broader connectivity challenges, such as VMs losing internet access, reviewing Ubuntu 22.04 VM on KVM/virt-manager Not Connecting to Internet can provide insights into similar networking stack troubleshooting techniques applicable to various Linux environments.

Frequently Asked Questions

Why does localhost work but the LAN IP does not?

This discrepancy usually indicates that a firewall is blocking incoming traffic on the external interface while allowing loopback traffic. It can also mean Apache is bound only to 127.0.0.1. Check UFW rules and Apache's ports.conf to ensure listening on all interfaces.

How do I reset UFW to default settings safely?

You can reset UFW by running sudo ufw reset, which clears all rules. Be cautious as this removes all existing protections. After resetting, manually add necessary rules like SSH and HTTP before enabling the firewall again with sudo ufw enable.

What if my router assigns a different IP to the Raspberry Pi?

DHCP leases can expire or change if the server reboots. Set a static DHCP reservation in your router’s admin panel for the Pi’s MAC address. This ensures the Pi always receives the same IP, making firewall rules and DNS entries stable over time.

Can I use IPv6 to access the local server?

Yes, if your router and ISP support IPv6, you can access the server via its IPv6 address. Ensure Apache is listening on IPv6 interfaces by checking ports.conf for Listen [::]:80. Test connectivity using curl -6 http://[ipv6_address] from a client with IPv6 enabled.

Why am I getting a 403 Forbidden error on the LAN IP?

A 403 error means the server reached Apache, but permissions prevented access. Check the ownership of your web root directory in /var/www/html. Ensure files are readable by the www-data user. Incorrect permissions, such as 700 on directories, often cause this issue on fresh installations.

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