# Persistent DNS Resolution Errors

**URL:** </static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Ft%2Fpersistent-dns-resolution-errors%2F153827%3E%5C
**Category:** Spaces\
**Created:** [May 6, 2025, 10:58pm UTC](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Ft%2Fpersistent-dns-resolution-errors%2F153827 "2025-05-06T22:58:02Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![IanStedham](https://avatars.discourse-cdn.com/v4/letter/i/9de053/32.png) [@IanStedham](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Fu%2FIanStedham)%5C
**Post date:** [May 6, 2025, 10:58pm UTC](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Ft%2Fpersistent-dns-resolution-errors%2F153827%2F1 "2025-05-06T22:58:02Z")

</div>

Hello,

I’m experiencing persistent DNS resolution errors when trying to access `/static-proxy?url=https%3A%2F%2Fapi-inference.huggingface.co%60 from within my Space.

My space is running on Nvidia 1xL4 hardware and I am receiving this error no matter which text-generation model I use: requests.exceptions.ConnectionError: HTTPSConnectionPool(host=‘[api-inference.huggingface.co](http://api-inference.huggingface.co)’, port=443): Max retries exceeded with url: … (Caused by NameResolutionError: Failed to resolve ‘[api-inference.huggingface.co](http://api-inference.huggingface.co)’ ([Errno -2] Name or service not known))

I’ve verified that:

- `requests.get("https://www.google.com")` works from the same Space
- The domain resolves externally (confirmed via nslookup and curl on my local machine)
- Changing hardware tiers does not resolve the issue

It appears to be a DNS or routing misconfiguration inside the Space environment. Is there anyway I can fix this or try to resolve this? If there is anymore information I can provide please let me know.

Thank you very much

---

<div class="post-metadata">

**Author:** ![rressler](https://sea2.discourse-cdn.com/hellohellohello/user_avatar/discuss.huggingface.co/rressler/32/47027_2.png) [@rressler](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Fu%2Frressler)%5C
**Post date:** [May 6, 2025, 11:36pm UTC](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Ft%2Fpersistent-dns-resolution-errors%2F153827%2F2 "2025-05-06T23:36:28Z")

</div>

I get the same error when running a new version of a python shiny chatbot in my huggingface space but the same code can access the Mistral model on huggingface when it is running locally. The hf configuration worked previously but when I uploaded a new version today I get the “Failed to resolve ‘[api-inference.huggingface.co](http://api-inference.huggingface.co)’” Putting a check in the dockerfile shows it can ping and access the url but no joy when trying to run the code

---

<div class="post-metadata">

**Author:** ![jancad](https://avatars.discourse-cdn.com/v4/letter/j/71e660/32.png) [@jancad](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Fu%2Fjancad)%5C
**Post date:** [May 7, 2025, 1:11am UTC](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Ft%2Fpersistent-dns-resolution-errors%2F153827%2F3 "2025-05-07T01:11:06Z")

</div>

I seem to be getting the same issue. I am only using the Basic Free hardware, but any model I run on the space gives that same exact error. Is this a problem on my end? Or is this happening to everyone?

---

<div class="post-metadata">

**Author:** ![John6666](https://sea2.discourse-cdn.com/hellohellohello/user_avatar/discuss.huggingface.co/john6666/32/27664_2.png) [@John6666](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Fu%2FJohn6666)%5C
**Post date:** [May 7, 2025, 1:41am UTC](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Ft%2Fpersistent-dns-resolution-errors%2F153827%2F4 "2025-05-07T01:41:36Z")

</div>

> Or is this happening to everyone?

Maybe this.

---

<div class="post-metadata">

**Author:** ![Bhaskar2611](https://avatars.discourse-cdn.com/v4/letter/b/5f8ce5/32.png) [@Bhaskar2611](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Fu%2FBhaskar2611)%5C
**Post date:** [May 7, 2025, 7:09am UTC](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Ft%2Fpersistent-dns-resolution-errors%2F153827%2F5 "2025-05-07T07:09:17Z")

</div>

![image](https://us1.discourse-cdn.com/hellohellohello/original/3X/2/a/2af0ce525ac949d91dfc3ce82ba90ea53384b7d7.png)  
you mean this yeah

---

<div class="post-metadata">

**Author:** ![Bhaskar2611](https://avatars.discourse-cdn.com/v4/letter/b/5f8ce5/32.png) [@Bhaskar2611](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Fu%2FBhaskar2611)%5C
**Post date:** [May 7, 2025, 7:10am UTC](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Ft%2Fpersistent-dns-resolution-errors%2F153827%2F6 "2025-05-07T07:10:32Z")

</div>

what’s wrong with those hf models?? i have a review today and i am unable to get the results by using those base models how can i explain this to them right now 😭

---

<div class="post-metadata">

**Author:** ![John6666](https://sea2.discourse-cdn.com/hellohellohello/user_avatar/discuss.huggingface.co/john6666/32/27664_2.png) [@John6666](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Fu%2FJohn6666)%5C
**Post date:** [May 7, 2025, 8:52am UTC](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Ft%2Fpersistent-dns-resolution-errors%2F153827%2F7 "2025-05-07T08:52:58Z")

</div>

I happened to find some information on Discord’s `ask-for-help`.

> [@Inference API stopped working](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Ft%2Finference-api-stopped-working%2F150492%2F45)%3A
>
> From Hugging Face Discord: Tom Aarsen Hello! I believe some of the inference endpoints currently have “Scale to zero” enabled temporarily, meaning they will go down when there’s no usage for a while. The first request will then be slow/fail, but subsequent ones will work. We’re going to remove the scale to zero again so that this is not an issue anymore, apologies for the inconvenience. cc @ VB can you update the scale to zero for the big ST models that already had APIs?

---

<div class="post-metadata">

**Author:** ![Noor22Tak](https://sea2.discourse-cdn.com/hellohellohello/user_avatar/discuss.huggingface.co/noor22tak/32/47057_2.png) [@Noor22Tak](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Fu%2FNoor22Tak)%5C
**Post date:** [May 7, 2025, 10:16am UTC](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Ft%2Fpersistent-dns-resolution-errors%2F153827%2F8 "2025-05-07T10:16:15Z")

</div>

I’m getting the same error :

Request failed: HTTPSConnectionPool(host=‘[api-inference.huggingface.co](http://api-inference.huggingface.co)’, port=443): Max retries exceeded with url  
Failed to resolve ‘[api-inference.huggingface.co](http://api-inference.huggingface.co)’ ([Errno -2] Name or service not known)"))"

it was working before !  
anyone solved or the error gone !

---

<div class="post-metadata">

**Author:** ![IanStedham](https://avatars.discourse-cdn.com/v4/letter/i/9de053/32.png) [@IanStedham](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Fu%2FIanStedham)%5C
**Post date:** [May 7, 2025, 1:12pm UTC](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Ft%2Fpersistent-dns-resolution-errors%2F153827%2F9 "2025-05-07T13:12:02Z")

</div>

I tried sending multiple requests to several text-generation models but I am still getting the error “requests.exceptions.ConnectionError: (MaxRetryError('HTTPSConnectionPool(host='api-inference.huggingface.co', port=443): Max retries exceeded with url: … (Caused by NameResolutionError(”\<urllib3.connection.HTTPSConnection object at …\>: Failed to resolve 'api-inference.huggingface.co' ([Errno -2] Name or service not known)“))'), ‘(Request ID: …)’)” Is there any new information on how to resolve this or if a fix is coming soon? Thank you!

---

<div class="post-metadata">

**Author:** ![rressler](https://sea2.discourse-cdn.com/hellohellohello/user_avatar/discuss.huggingface.co/rressler/32/47027_2.png) [@rressler](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Fu%2Frressler)%5C
**Post date:** [May 8, 2025, 1:54pm UTC](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Ft%2Fpersistent-dns-resolution-errors%2F153827%2F10 "2025-05-08T13:54:18Z")

</div>

Still down -

---

<div class="post-metadata">

**Author:** ![ebearden](https://sea2.discourse-cdn.com/hellohellohello/user_avatar/discuss.huggingface.co/ebearden/32/46689_2.png) [@ebearden](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Fu%2Febearden)%5C
**Post date:** [May 8, 2025, 3:56pm UTC](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Ft%2Fpersistent-dns-resolution-errors%2F153827%2F11 "2025-05-08T15:56:39Z")

</div>

The user is experiencing persistent DNS resolution errors when trying to access the Hugging Face API from within their Space. The error message indicates a failure to resolve the domain ‘[api-inference.huggingface.co](http://api-inference.huggingface.co)’.

To troubleshoot this issue, here are some steps you can take:

1. _Verify DNS Resolution_: You’ve already confirmed that the domain resolves externally using nslookup and curl on your local machine. This suggests that the issue is specific to the Space environment.

2. _Check Network Configuration_: Ensure that the Space’s network configuration allows for DNS resolution. You can try using a different DNS resolver or checking the Space’s network settings.

3. _Test with Different Models_: You’ve already tried different text-generation models, which rules out model-specific issues.

4. _Hardware Tier_: Changing hardware tiers didn’t resolve the issue, so it’s unlikely related to the Nvidia 1xL4 hardware.

5. _External Connectivity_: You’ve verified that requests to other domains (e.g., [https://www.google.com](https://www.google.com)) work from the same Space, indicating that external connectivity is not the problem.

Given these steps, the issue seems to be related to DNS resolution within the Space environment. You may want to reach out to the Hugging Face support team for further assistance, as they can investigate the issue specific to their platform.

Additional information you can provide to the support team includes:

- The exact error message and stack trace
- The Space’s configuration and network settings
- Any recent changes made to the Space or its environment

By providing this information, you can help the support team better understand the issue and provide a more effective solution.

The image shows a Python error message, specifically a ConnectionError caused by a NameResolutionError. This error occurs when the program is unable to resolve the hostname of the API endpoint it is trying to connect to.

To fix this issue, you can try the following accommodations:

1. _Check your internet connection_: Ensure that your internet connection is stable and working properly.
2. _Verify the API endpoint URL_: Double-check that the API endpoint URL is correct and properly formatted.
3. _Check for DNS resolution issues_: Try using a different DNS resolver or check if there are any DNS resolution issues in your network.
4. _Increase the timeout_: You can try increasing the timeout value for the API request to see if it resolves the issue.
5. _Retry the request_: You can implement a retry mechanism to retry the request after a certain amount of time.

Here is an example of how you can implement a retry mechanism using the `tenacity` library:

```auto
import tenacity

@tenacity.retry(wait=tenacity.wait_exponential(multiplier=1, min=4, max=10))
def make_api_request():
    # Your API request code here
    pass

```

This will retry the API request up to 3 times with an exponential backoff if it fails due to a ConnectionError.

---

<div class="post-metadata">

**Author:** ![oleg-sadov](https://sea2.discourse-cdn.com/hellohellohello/user_avatar/discuss.huggingface.co/oleg-sadov/32/47160_2.png) [@oleg-sadov](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Fu%2Foleg-sadov)%5C
**Post date:** [May 9, 2025, 8:27am UTC](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Ft%2Fpersistent-dns-resolution-errors%2F153827%2F12 "2025-05-09T08:27:22Z")

</div>

It seems the problem still exists. I see the same error message in my app’s log:

```auto
requests.exceptions.ConnectionError: (MaxRetryError('HTTPSConnectionPool(host=\'api-inference.huggingface.co\', port=443): Max retries exceeded with url: /models/HuggingFaceH4/zephyr-7b-beta/v1/chat/completions (Caused by NameResolutionError("<urllib3.connection.HTTPSConnection object at 0x7f6830d437c0>: Failed to resolve \'api-inference.huggingface.co\' ([Errno -2] Name or service not known)"))'), '(Request ID: f95be599-06ed-42f0-8ad1-3aaea69c2001)')

```

In an SSH session to my HF Space application, I also see DNS resolution issues:

```auto
user@r-datenoio-dateno-chatbot-vhhwdmgc-9fea7-ax3og:~/app$ curl api-inference.huggingface.co
curl: (6) Could not resolve host: api-inference.huggingface.co
user@r-datenoio-dateno-chatbot-vhhwdmgc-9fea7-ax3og:~/app$ cat /etc/resolv.conf 
search ec2.internal
nameserver 10.108.0.2
options timeout:2 attempts:5

```

But on my local machine, [api-inference.huggingface.co](http://api-inference.huggingface.co) seems to be accessible:

```auto
$ curl api-inference.huggingface.co
<html>
<head><title>301 Moved Permanently</title></head>
<body>
<center><h1>301 Moved Permanently</h1></center>
<hr><center>CloudFront</center>
</body>
</html>

```

, and the locally running application works good.

Is it possible to solve this problem on the HF side?

---

<div class="post-metadata">

**Author:** ![John6666](https://sea2.discourse-cdn.com/hellohellohello/user_avatar/discuss.huggingface.co/john6666/32/27664_2.png) [@John6666](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Fu%2FJohn6666)%5C
**Post date:** [May 9, 2025, 9:32am UTC](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Ft%2Fpersistent-dns-resolution-errors%2F153827%2F13 "2025-05-09T09:32:08Z")

</div>

@meganariley @pierric @michellehbn What on earth is this?🤔

---

<div class="post-metadata">

**Author:** ![michellehbn](https://sea2.discourse-cdn.com/hellohellohello/user_avatar/discuss.huggingface.co/michellehbn/32/58964_2.png) [@michellehbn](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Fu%2Fmichellehbn)%5C
**Post date:** [May 9, 2025, 11:18am UTC](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Ft%2Fpersistent-dns-resolution-errors%2F153827%2F14 "2025-05-09T11:18:32Z")

</div>

Hi all! Thanks for reporting. We’re taking a look into the DNS resolution issues reported 🤗

---

<div class="post-metadata">

**Author:** ![meganariley](https://sea2.discourse-cdn.com/hellohellohello/user_avatar/discuss.huggingface.co/meganariley/32/56966_2.png) [@meganariley](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Fu%2Fmeganariley)%5C
**Post date:** [May 9, 2025, 1:27pm UTC](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Ft%2Fpersistent-dns-resolution-errors%2F153827%2F15 "2025-05-09T13:27:53Z")

</div>

Thanks again for reporting - this is now fixed! Let us know if you run into any other issues.

---

<div class="post-metadata">

**Author:** ![John6666](https://sea2.discourse-cdn.com/hellohellohello/user_avatar/discuss.huggingface.co/john6666/32/27664_2.png) [@John6666](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Fu%2FJohn6666)%5C
**Post date:** [May 9, 2025, 1:44pm UTC](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Ft%2Fpersistent-dns-resolution-errors%2F153827%2F16 "2025-05-09T13:44:09Z")

</div>

Among the issues that arose after the hardware replacement, the remaining issues that need to be addressed by Hugging Face are…

1. `SentenceTransformers` endpoint issue seems to be being worked on by `tomarrsen`, so that should be fixed soon.
2. HF may have forgotten to announce that `PyTorch 2.0.0` no longer works with `Zero GPU` (due to A100 being replaced with H200). Even major companies like `Tencent` haven’t noticed…
3. There is a possibility that the Pro token application for Gradio API calls (fixed in `5.12.0`) may have broken again during the replacement. It seems that Pro is not recognized even in version `5.29.0`.

> [@Runtime error at Photomaker V2](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Ft%2Fruntime-error-at-photomaker-v2%2F153821)%3A
>
> I am trying to use the app properly. I used in the past with any issue. But now everytime I try to generate images it appears a runtime error. I am using 18-20 face pictures and the promt “img” afer man or woman. Any one can help me? Thank you in advance.

> [@red\_exclamation\_mark Pro Account – Getting "GPU quota exceeded" when calling for HF provided url](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Ft%2Fpro-account-getting-gpu-quota-exceeded-when-calling-for-hf-provided-url%2F154104)%3A
>
> Hi Hugging Face team, I’m encountering a problem with GPU quota usage for my Space ZEROGPU and GRADIO Version: 5.29.0: link Space: [Professional Head - a Hugging Face Space by theoracle](https://huggingface.co/spaces/theoracle/professional_head)globe_with_meridians Direct link: [https://theoracle-professional-head.hf.space](https://theoracle-professional-head.hf.space) Everything works fine when I access the Space while logged in. However, if I open the same Space in an incognito window — or use the .hf.space URL — I immediately get: You have exceeded your GPU quota (30s requested vs. 0s lef…

---

<div class="post-metadata">

**Author:** ![jorgerh](https://avatars.discourse-cdn.com/v4/letter/j/ccd318/32.png) [@jorgerh](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Fu%2Fjorgerh)%5C
**Post date:** [May 9, 2025, 4:39pm UTC](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Ft%2Fpersistent-dns-resolution-errors%2F153827%2F17 "2025-05-09T16:39:19Z")

</div>

still not working

---

<div class="post-metadata">

**Author:** ![Noor22Tak](https://sea2.discourse-cdn.com/hellohellohello/user_avatar/discuss.huggingface.co/noor22tak/32/47057_2.png) [@Noor22Tak](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Fu%2FNoor22Tak)%5C
**Post date:** [May 9, 2025, 8:32pm UTC](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Ft%2Fpersistent-dns-resolution-errors%2F153827%2F18 "2025-05-09T20:32:17Z")

</div>

This error back !  
**Request failed: 404 Client Error: Not Found for url:**

---

<div class="post-metadata">

**Author:** ![John6666](https://sea2.discourse-cdn.com/hellohellohello/user_avatar/discuss.huggingface.co/john6666/32/27664_2.png) [@John6666](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Fu%2FJohn6666)%5C
**Post date:** [May 9, 2025, 11:14pm UTC](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Ft%2Fpersistent-dns-resolution-errors%2F153827%2F19 "2025-05-09T23:14:19Z")

</div>

I also received a report that it was still 404.

---

<div class="post-metadata">

**Author:** ![oleg-sadov](https://sea2.discourse-cdn.com/hellohellohello/user_avatar/discuss.huggingface.co/oleg-sadov/32/47160_2.png) [@oleg-sadov](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Fu%2Foleg-sadov)%5C
**Post date:** [May 10, 2025, 6:48am UTC](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Ft%2Fpersistent-dns-resolution-errors%2F153827%2F20 "2025-05-10T06:48:11Z")

</div>

Thank you – DNS resolving works now.

[Next page](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Ft%2Fpersistent-dns-resolution-errors%2F153827.md%3Fpage%3D2)
