DNS resolution issue with Azure OpenAI provider when running in WSL

Resolved 💬 6 comments Opened Nov 2, 2025 by etraut-openai Closed Nov 15, 2025
💡 Likely answer: A maintainer (etraut-openai, contributor) responded on this thread — see the highlighted reply below.

Platform: WSL on Windows

Issue https://github.com/openai/codex/issues/1552 details a number of general issues related to the Azure OpenAI service provider.

I'm opening this issue to focus specifically on a DNS resolution problem that appears to be affecting many users.

@doggy8088 has done some great analysis and has provided details here in the thread.

For convenience, I'm pasting the workaround suggested in the other thread.

Workaround

To work around the issue, you can add a statically mapped DNS record to the /etc/hosts file.

# This file was automatically generated by WSL. To stop automatic generation of this file, add the following entry to /etc/wsl.conf:
# [network]
# generateHosts = false
127.0.0.1       localhost
<feff>
127.0.0.1       localhost

# The following lines are desirable for IPv6 capable hosts
::1     ip6-localhost ip6-loopback
fe00::0 ip6-localnet
ff00::0 ip6-mcastprefix
ff02::1 ip6-allnodes
ff02::2 ip6-allrouters

# Add this line below. Make sure the IP is correct.
20.232.91.180    test.openai.azure.com

View original on GitHub ↗

6 Comments

etraut-openai contributor · 9 months ago
etraut-openai contributor · 9 months ago

@doggy8088, thanks again for your debugging and analysis. If you'd like to review this PR, we'd appreciate any feedback you have.

illgitthat · 9 months ago

Hi @etraut-openai - is this supposed to be fixed in 0.58? I just tested and I still see the same issue? Can you reopen this?

<img width="1113" height="626" alt="Image" src="https://github.com/user-attachments/assets/99984e94-3236-4fbd-acac-972a96e3f0dd" />

<img width="1113" height="626" alt="Image" src="https://github.com/user-attachments/assets/88d641db-227a-4064-9862-2b634cf35e27" />

etraut-openai contributor · 9 months ago

@illgitthat, the fix will be in the next published version.

illgitthat · 9 months ago
@illgitthat, the fix will be in the next published version.

Hi @etraut-openai I have the same issue in v0.59.0 after updating today. Would you like to reopen this issue or would you like me to open a new issue?

etraut-openai contributor · 9 months ago

@illgitthat, please open a new issue if you think that there isn't an existing open issue that describes the problem you're seeing. If you are using a network proxy or VPN, include those details. Thanks!