DNS resolution issue with curl in UBI container that uses custom podman network: "curl: (6) Could not resolve host: login.microsoftonline.com"

Solution Unverified - Updated -

Issue

  • When trying to curl login.microsoftonline.com from inside of a container that uses a custom Podman network, resolution fails with "curl: (6) Could not resolve host: login.microsoftonline.com".
[root@9aee42cba8cb /]# curl https://login.microsoftonline.com
curl: (6) Could not resolve host: login.microsoftonline.com
  • Curl resolves successfully to other domains.
[root@9aee42cba8cb /]# curl https://google.com
<HTML><HEAD><meta http-equiv="content-type" content="text/html;charset=utf-8">
<TITLE>301 Moved</TITLE></HEAD><BODY>
<H1>301 Moved</H1>
The document has moved
<A HREF="https://www.google.com/">here</A>.
</BODY></HTML>

Environment

  • Red Hat Enterprise Linux 9
  • Podman v5.x
  • UBI 8/9

Subscriber exclusive content

A Red Hat subscription provides unlimited access to our knowledgebase, tools, and much more.

Current Customers and Partners

Log in for full access

Log In

New to Red Hat?

Learn more about Red Hat subscriptions

Using a Red Hat product through a public cloud?

How to access this content