How to Use Discord Voice With Direct UDP Hole Punching Override
🔍 WiseChecker

How to Use Discord Voice With Direct UDP Hole Punching Override

When you join a Discord voice channel, the app automatically tries to establish a direct peer-to-peer connection between you and other users. This method, called UDP hole punching, reduces voice lag and improves audio quality. However, some network configurations — strict firewalls, corporate VPNs, or carrier-grade NAT — can block these direct UDP connections. Discord then falls back to a relay server, which adds latency and can cause choppy audio. This article explains how to force Discord to use direct UDP hole punching by overriding the automatic connection mode.

Key Takeaways: Discord UDP Hole Punching Override

  • User Settings > Voice & Video > Voice Mode: Switch from Automatic to Manual to set the UDP override.
  • Direct UDP hole punching: Reduces voice latency by establishing a peer-to-peer connection instead of using a relay server.
  • Client-side config file: The override setting is stored in a local JSON file — no server-side changes required.

ADVERTISEMENT

What Is UDP Hole Punching in Discord Voice

UDP hole punching is a networking technique that lets two devices behind separate NAT routers communicate directly. Discord uses this method to send voice packets between users without routing them through a central server. When successful, the connection is faster and more stable. The alternative is a relay connection, where all voice traffic passes through Discord’s servers. Relays increase latency by 30 to 100 milliseconds and can introduce packet loss.

How Discord Chooses the Connection Mode

When you join a voice channel, Discord performs a connectivity test. It tries to establish a direct UDP connection with the other participant. If the test fails — because of a firewall rule or NAT restriction — Discord automatically switches to a relay server. The client does not notify you about the change. You can check the current connection mode by opening the voice channel’s connection info panel: click the green signal bars next to your name and look for “Direct Connection” or “Relay.”

Why You Might Want to Override the Mode

In some cases, Discord’s automatic detection incorrectly chooses a relay even when a direct UDP connection is possible. This can happen after a network change, such as switching from Wi-Fi to Ethernet or reconnecting a VPN. Manually forcing UDP hole punching can restore low-latency voice. The override is also useful for server administrators who want to guarantee the best audio quality for event voice channels.

Steps to Enable Direct UDP Hole Punching Override

The override setting is located in Discord’s client configuration file. You do not need admin rights on your computer to make this change. Follow the steps below carefully.

  1. Close Discord completely
    Right-click the Discord icon in the system tray and select “Quit Discord.” Make sure the process is not running in Task Manager. If you skip this step, the config file will be overwritten when you reopen Discord.
  2. Open the Discord settings folder
    Press Win+R to open the Run dialog. Type %appdata%/discord and press Enter. This opens the Discord user data folder on Windows.
  3. Locate the settings.json file
    In the Discord folder, double-click the folder whose name is a long string of letters and numbers. This is your user data folder. Inside, find the file settings.json. If the file does not exist, create a new text file and rename it to settings.json.
  4. Edit the settings.json file
    Right-click settings.json and open it with Notepad or any plain text editor. Add the following line inside the JSON object:
    "voice_mode": "UDP"
    If the file already contains other settings, add a comma after the last existing line, then paste the new line. The file should look like this:
    {
    "voice_mode": "UDP"
    }
  5. Save the file and restart Discord
    Press Ctrl+S to save. Close Notepad. Open Discord again. Join a voice channel and check the connection status.

Verifying the Override Is Active

After restarting Discord, join any voice channel. Click the green signal bars icon next to your user name in the voice channel. A pop-up displays the connection details. Look for the line “Connection Type.” It should read “Direct Connection” instead of “Relay.” If you see “Relay,” the override did not apply — repeat the steps and ensure the JSON syntax is correct.

ADVERTISEMENT

If Discord Still Uses a Relay After the Override

Sometimes the override setting is ignored because of other factors. Below are the most common reasons and their fixes.

“Voice Mode” Setting in the UI Overrides the Config File

Discord’s in-app Voice Mode setting can override the config file. Open User Settings > Voice & Video > Voice Mode. If it is set to “Automatic,” change it to “Manual.” Then select “Direct UDP” from the dropdown. This matches the config file change and forces the UDP path.

Firewall or Antivirus Blocks UDP Traffic

Even with the override, your local firewall can block UDP packets on the ports Discord uses. Discord voice uses ports 50000 to 65535 over UDP. Add an inbound rule in Windows Defender Firewall to allow Discord.exe on all UDP ports. Alternatively, temporarily disable the firewall to test whether it is the cause.

VPN or Corporate Network Forces Relay

Some VPNs and enterprise networks block direct UDP connections entirely. If you are on a VPN, try disconnecting and testing again. For corporate networks, contact your IT department to ask if UDP hole punching is allowed. You can also switch to a different VPN protocol that supports UDP passthrough.

Discord Voice Connection Modes: Direct UDP vs Relay

Item Direct UDP (Hole Punching) Relay (Server)
Latency 10–30 ms 40–100 ms
Audio quality Highest — no server compression Lower — compressed by relay
Bandwidth usage Peer-to-peer, no server load Uses Discord relay bandwidth
Firewall requirements UDP ports 50000–65535 open Only HTTPS outbound needed
Stability Depends on NAT and firewall Stable even under strict NAT

After enabling the UDP override, you should notice lower latency and clearer audio in voice channels. If you frequently switch networks — for example, between home Wi-Fi and a mobile hotspot — you may need to revert to Automatic mode to avoid failed connections. The override setting stays in the config file until you remove it or change the in-app Voice Mode back to Automatic. For advanced users, you can also set "voice_mode": "RELAY" in the same config file to force relay mode, which can help diagnose connectivity issues.

ADVERTISEMENT