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

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 ↗

This issue has 6 comments on GitHub. Read the full discussion on GitHub ↗