# Unauthorized"}curl: (6) Could not resolve host: application

**URL:** <https://community.auth0.com/t/unauthorized-curl-6-could-not-resolve-host-application/102720>\
**Category:** Get Help\
**Tags:** configuration, application\
**Created:** [March 16, 2023, 4:58pm UTC](https://community.auth0.com/t/unauthorized-curl-6-could-not-resolve-host-application/102720 "2023-03-16T16:58:22Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![GurdipS](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/gurdips/32/16812_2.png) [@GurdipS](https://community.auth0.com/u/GurdipS)\
**Post date:** [March 16, 2023, 4:58pm UTC](https://community.auth0.com/t/unauthorized-curl-6-could-not-resolve-host-application/102720/1 "2023-03-16T16:58:22Z")

</div>

Hi  
I want to get the token for an API I am protecting via Auth0. Auth0 provides the code:

```auto
curl --request POST \
  --url https://xxx.eu.auth0.com/oauth/token \
  --header 'content-type: application/json' \
  --data '{"client_id":"xxx","client_secret":"xxx","audience":"xxx","grant_type":"client_credentials"}'

```

I have x’d out some values for privacy, but I get this error;

{“error”:“access\_denied”,“error\_description”:“Unauthorized”}curl: (6) Could not resolve host: application

Presumably the unresolved address is the audience, as this was a url that does not resolve from where I run the command from. What should the IP of that host name be? The server hosting the API I built?

Thanks

---

<div class="post-metadata">

**Author:** ![matt.g](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/matt.g/32/35982_2.png) [@matt.g](https://community.auth0.com/u/matt.g)\
**Post date:** [March 29, 2023, 10:27pm UTC](https://community.auth0.com/t/unauthorized-curl-6-could-not-resolve-host-application/102720/3 "2023-03-29T22:27:21Z")

</div>

Hi @GurdipS,

Welcome back to the Auth0 Community!

Are you by chance using a custom domain in your tenant? If so, are you referencing that custom domain in `--url https://xxx.eu.auth0.com/oauth/token`? Requests to the Management API are one of the few places where you’ll still want to use your canonical domain instead of your custom domain.

I hope this helps!

Thanks,  
Matt

---

<div class="post-metadata">

**Author:** ![system](https://global.discourse-cdn.com/auth0/original/3X/b/5/b560f266932fcce5d57f09a6595bd50518cae3f3.jpeg) [@system](https://community.auth0.com/u/system)\
**Post date:** [December 9, 2024, 10:59pm UTC](https://community.auth0.com/t/unauthorized-curl-6-could-not-resolve-host-application/102720/4 "2024-12-09T22:59:19Z")

</div>

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.
