How to allow a website through the Windows firewall (apps, ports and IP addresses)
TL;DR: Windows Defender Firewall filters apps, ports and IP addresses, not website names. To let a site or service through, allow the app that connects to it (your browser, FTP client or database tool), or add an outbound rule for the port or IP address. Use Windows Security, Firewall & network protection, Allow an app through firewall for apps, and Windows Defender Firewall with Advanced Security for ports. If a site is blocked in the browser only, the cause may be a proxy, antivirus, DNS or the hosts file instead.
First, confirm the firewall is the problem
Before you change rules:
- Try another browser or device on the same network.
- Try the site on mobile data.
- Run
pingor open the site by IP if you know it. - Temporarily test with the firewall off on a private network and turn it back on straight away. Do not leave it off.
If the site opens on other networks but not yours, the cause may be your router, ISP, DNS or security software. See how to check DNS records.
Option 1: allow an app
- Open Windows Security, then Firewall & network protection.
- Choose Allow an app through firewall.
- Click Change settings, then Allow another app.
- Browse to the program, for example your browser, FileZilla or an SSH client.
- Tick Private and, only if needed, Public.
- Click OK.
Option 2: allow a port or an IP address
- Open Windows Defender Firewall with Advanced Security.
- Select Outbound Rules (or Inbound Rules for incoming connections), then New Rule.
- Choose Port for a service such as 443 or 3306, or Custom to specify a remote IP address.
- Select Allow the connection.
- Choose the profiles (Domain, Private, Public).
- Name the rule clearly and finish.
Or with PowerShell as administrator:
New-NetFirewallRule -DisplayName "Allow HTTPS to host" -Direction Outbound -Protocol TCP -RemotePort 443 -RemoteAddress 203.0.113.10 -Action Allow
Replace the example address with the server's IP. Find it with nslookup yourdomain.com.
If a rule does not help
- Third-party antivirus or web protection may block it separately.
- Hosts file. Check
C:\Windows\System32\drivers\etc\hostsfor an entry that redirects the domain. - Proxy or VPN settings may interfere.
- Router or office firewall may block the site. Ask your network admin.
- The server may be blocking you. If your IP is blocked on the server side, see IP address blocked. A server firewall is covered in firewall plugin vs host firewall.
Keep it safe
Allow the smallest scope: one app, one port, one remote address, private network only. Remove rules you no longer need and avoid blanket "allow all" rules.
FAQs
How do I allow a website in Windows Firewall?
You allow the app or the IP and port it uses. The firewall does not filter by site name.
How do I open a port in Windows Firewall?
Create an inbound or outbound rule for that port in Windows Defender Firewall with Advanced Security.
Why can't I open a website even with the firewall off?
The cause may be DNS, a proxy, antivirus, your router or the site itself.
Is it safe to turn off Windows Firewall?
Not for long. Use it only briefly to test, then turn it on.
How do I find a website's IP address?
Run nslookup or ping with the domain name in Command Prompt.
Should I allow public network access?
Only when needed. Prefer the private profile on trusted networks.
How do I reset the firewall rules?
In Windows Security, choose Firewall & network protection, then Restore firewalls to default. Note that this removes custom rules.
Does the Windows firewall block outgoing traffic by default?
Default settings generally allow outbound traffic and block unsolicited inbound traffic, but company policy can change this.
Conclusion
Allow only what you need: an app, a port or an IP address, on the right network profile. If the site still does not open, test from another network and check DNS, proxy and security software before touching more rules.
HostCloud helps Indian websites with reliable hosting, domains and support. See the options at https://hostcloud.in.
Sources: