Internal website loads by IP but not hostname fix
Your browser can't resolve the hostname to an IP. DNS or hosts file is the usual culprit. Here's how to fix it step by step.
Quick answer
Check your DNS server or hosts file. Run ipconfig /flushdns and try nslookup hostname. If it fails, add the hostname to your hosts file manually.
Why this happens
When you type a hostname like intranet or server01 into your browser, your computer asks a DNS server to translate that name into an IP address. If the DNS server doesn't have a record for it—or if your local DNS cache has a stale entry—the translation fails. Your browser then gives you a 'DNS_PROBE_FINISHED_NXDOMAIN' or 'Server not found' error. But if you type the IP directly (like 192.168.1.50), the page loads fine. That tells you the network connection and the web server are working. The problem is purely in the name resolution layer.
I see this most often in small office networks where someone set up an internal web app but forgot to register it in the company's internal DNS. Or it happens after you change a server's IP and the old address is still cached somewhere. Sometimes it's as simple as a typo in the hosts file.
Fix steps
- First, flush your DNS cache. Open Command Prompt as Administrator (right-click Start > Command Prompt Admin). Type
ipconfig /flushdnsand press Enter. You'll see 'Successfully flushed the DNS Resolver Cache.' This clears any old or corrupt DNS entries your computer stored locally. - Then, test the resolution. In the same command prompt, type
nslookup yourhostname(replace 'yourhostname' with the actual hostname you're trying to reach). If it returns an IP address, the DNS server is working correctly. If it says 'Non-existent domain' or 'server can't find', the DNS server doesn't have a record for that hostname. - Check your network's DNS server. If nslookup failed, you need to find the correct IP address for the hostname. Ask your network admin or check the server's own IP (if it's a local server, log into it and run
ipconfig). Once you have the IP, you can add a manual entry to your hosts file. - Edit the hosts file. Open Notepad as Administrator (right-click Notepad > Run as administrator). Go to
C:\Windows\System32\drivers\etc\hosts. You'll see a file with some example entries. Add a new line at the bottom like this:192.168.1.50 intranet(replace the IP and hostname with yours). Save the file. No extension, just 'hosts'. - Test again. Open your browser and type the hostname. It should now load the website. If it still doesn't, close and reopen your browser completely—some browsers cache DNS too.
Alternative fixes if the main steps don't work
- Check your browser's DNS cache. Chrome and Edge have their own DNS cache. Type
chrome://net-internals/#dnsin the address bar and click 'Clear host cache'. For Firefox, typeabout:networking#dnsand click 'Clear DNS Cache'. - Disable IPv6 temporarily. Some internal DNS setups misbehave with IPv6. Go to Control Panel > Network and Sharing Center > Change adapter settings. Right-click your active network adapter, select Properties, uncheck 'Internet Protocol Version 6 (TCP/IPv6)', click OK. Reboot or run
ipconfig /renew. - Try a different device. If another computer on the same network can reach the hostname, the problem is local to your machine. If no device can, the issue is on the DNS server side—contact your network admin to add the host record.
- Check for proxy settings. If your browser uses a proxy, it might bypass internal DNS. Go to Windows Proxy settings (search 'Proxy settings') and make sure 'Automatically detect settings' is on, and no manual proxy is set for your local addresses.
Prevention tip
Prevent this from happening again by making sure the hostname gets registered in your internal DNS server. If you're the admin, create an A record for the server's hostname pointing to its static IP. If you don't control the DNS, keep the hosts file updated on every machine that needs access. A quick script can push hosts entries via Group Policy in a Windows domain.
Also, avoid using the same hostname for different IPs over time—old DNS caches will clash. If you must change a server's IP, lower the DNS TTL for that record ahead of time so clients pick up the new IP faster.
Was this solution helpful?