Whitelist Discord Endpoints in pfSense: Step-by-Step
In this article
To whitelist Discord endpoints in pfSense, you create firewall rules that allow traffic to Discord's official IP ranges and domains. This is useful if you're running a strict firewall or geo-blocking and Discord isn't working. You'll need pfSense admin access and a list of Discord's current IP ranges (they change, so verify them at the time of setup).
What You'll Need
- pfSense admin credentials (web interface).
- Discord's IP ranges. Get them from Discord's official support page or a trusted IP range lookup service (e.g.,
discord.comresolves to Cloudflare IPs, but you need the specific ranges Discord publishes). - Optional: a list of Discord's domain names (e.g., discord.com, discord.gg, discordapp.com, discord.media, discordapp.net).
Step-by-Step
- Log into pfSense – Open your pfSense web interface (usually
https://192.168.1.1) and enter your admin username and password. - Back up your current config – Go to Diagnostics > Backup/Restore and download a backup. This ensures you can revert if something goes wrong.
- Find Discord's IP ranges – Visit Discord's official support article (search "Discord IP ranges") or use a service like
ipinfo.ioto look up the IPs fordiscord.com. As of writing, Discord uses Cloudflare, so you may need to allow Cloudflare's ranges, but Discord also publishes specific ranges. Write them down or copy them. - Create an Alias for Discord IPs – Go to Firewall > Aliases, click Add. Name it
Discord_IPs, typeNetworkorHost, and add each IP range or single IP. Save. - Create an Alias for Discord Domains (optional) – If you want to allow by domain (for DNS-based filtering), create another alias of type
Hostand add the domains:discord.com,discord.gg,discordapp.com,discord.media,discordapp.net. Save. - Add a firewall rule on the WAN interface – Go to Firewall > Rules, select the WAN tab. Click Add to create a new rule.
- Configure the rule – Set Action to Pass, Protocol to TCP/UDP (or choose specific ports if you know them; Discord uses 443 and 80, plus UDP for voice). In Destination, choose Alias and select
Discord_IPs. If you also want to match by domain, you can add a separate rule or use the domain alias in the destination (pfSense can resolve host aliases). Set Description to something like "Allow Discord". - Add a rule for Discord voice (UDP) – Discord voice uses UDP on a range of ports. Add another rule with Protocol UDP, destination alias
Discord_IPs, and set Destination Port to Any (or the specific range Discord uses, e.g., 50000-65535, but that's not officially documented; safer to allow all UDP to Discord IPs). - Place the rules at the top – Drag them above any blocking rules. By default, pfSense uses a last-match-wins approach, so if you have a block-all rule, the pass rules must be higher.
- Apply changes – Click Apply Changes at the top of the rules page.
- Test Discord – Try opening Discord on your device. If it still fails, check the firewall logs (Status > System Logs > Firewall) to see if traffic is being blocked.
Common Mistakes
- Using outdated IP ranges – Discord's IPs change. Always re-verify before relying on them.
- Forgetting UDP for voice – Allowing only TCP will let you log in, but voice chat will fail. You must allow UDP to Discord's IPs.
- Placing rules in the wrong order – If you have a block rule above your pass rule, the block wins. Ensure your pass rules are on top.
- Using the wrong interface – If you're blocking on LAN, you need to add rules on LAN, not WAN. For outbound traffic, WAN rules are usually fine, but if you have a floating rule, it might override.
- Not saving aliases – If you forget to save the alias, the rule won't work. Always click Save after creating an alias.
Tips
- Use a port-based rule – Instead of allowing all ports, you can allow TCP 443 and 80, and UDP 50000-65535 (the common range for Discord voice). This is more secure.
- Test with a single device – Temporarily disable your firewall rules and see if Discord works. If it does, then re-enable and adjust.
- Monitor logs – After applying, watch the firewall logs to see if any Discord traffic is still being dropped. You can filter by destination IP.
- Consider using a floating rule – If you have multiple interfaces, a floating rule can apply to all of them, but be careful—it's easy to create a security hole.
Troubleshooting
If Discord still doesn't work after whitelisting:
- Check the firewall logs – Go to Status > System Logs > Firewall. Look for blocked packets to Discord's IPs. If you see them, your rule isn't matching.
- Verify your alias – Ensure the alias contains the correct IPs. Try pinging or using
nslookupto see what IPs Discord resolves to on your network. - Clear your DNS cache – On your device, flush DNS (e.g.,
ipconfig /flushdnson Windows) to ensure you're resolving to the latest IPs. - Check for other blocking – pfSense might have a DNS resolver or a proxy blocking traffic. Check Services > DNS Resolver and any proxy settings.
- Try a different device – If one device works and another doesn't, the issue is on that device, not the firewall.
- Restart pfSense – Sometimes rules don't apply cleanly. Reboot the firewall (careful, this drops all connections).
Frequently Asked Questions
Do I need to whitelist both IPs and domains?
Not necessarily. If you whitelist IPs, that covers all traffic to those IPs. Domains are useful if you're using DNS-based filtering, but IPs are more reliable since Discord's domains resolve to those IPs.
What ports does Discord use?
Discord uses TCP 443 (HTTPS) and 80 (HTTP) for most traffic, and UDP for voice (typically ports 50000-65535, but the exact range is not officially published). It's safer to allow all UDP to Discord IPs.
Will whitelisting Discord affect my other traffic?
No, whitelisting only allows traffic to those specific IPs. It doesn't change rules for other destinations.
Can I use a domain alias instead of IPs?
Yes, pfSense can resolve host aliases to IPs, but this requires the DNS resolver to be working and the alias to be updated automatically. However, IPs are more reliable because they don't depend on DNS resolution.
What if Discord's IPs change?
You'll need to update your alias. You can set up a cron job to update the alias automatically, but that's advanced. For most users, manual updates when issues arise are fine.
Is it better to block everything else and allow Discord?
That depends on your security needs. If you want to allow only Discord, you can create a default-deny rule and then add pass rules for Discord. But be careful—you might block other necessary services.