# Curl: (6) could not resolve host

**URL:** <https://community.auth0.com/t/curl-6-could-not-resolve-host/71355>\
**Category:** Get Help\
**Tags:** test\
**Created:** [October 14, 2021, 8:48pm UTC](https://community.auth0.com/t/curl-6-could-not-resolve-host/71355 "2021-10-14T20:48:03Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![msk990](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/msk990/32/14222_2.png) [@msk990](https://community.auth0.com/u/msk990)\
**Post date:** [October 14, 2021, 8:48pm UTC](https://community.auth0.com/t/curl-6-could-not-resolve-host/71355/1 "2021-10-14T20:48:03Z")

</div>

Hi,  
When I create a new API and then try to get a token from it through cUrl like this  
curl --request POST   
–url [https://dev-uswrsjid.us.auth0.com/oauth/token](https://dev-uswrsjid.us.auth0.com/oauth/token)   
–header ‘content-type: application/json’   
–data ‘{“client\_id”:“6AUMmEzcmCWtMc1O72gQHnVhrIUR11gs”,“client\_secret”:“dxNnovSaR6S2yJw4HKfi2nSWRaOLA7pykqcokOAJHXGsj24GSV25qN106z5MWOA5”,“audience”:“[http://localfood.fun](http://localfood.fun)”,“grant\_type”:“client\_credentials”}’  
I get this error  
curl: (6) Could not resolve host:   
Any idea what the problem might be?  
Thanx,  
Maria

---

<div class="post-metadata">

**Author:** ![marcus.baker](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/marcus.baker/32/8586_2.png) [@marcus.baker](https://community.auth0.com/u/marcus.baker)\
**Post date:** [October 14, 2021, 9:07pm UTC](https://community.auth0.com/t/curl-6-could-not-resolve-host/71355/2 "2021-10-14T21:07:04Z")

</div>

Hi!

I was unable to get your curl command to work.  
I generated one from PostMan and this works:

```auto
url --location --request POST 'https://dev-uswrsjid.us.auth0.com/oauth/token' \
--header 'Content-Type: application/x-www-form-urlencoded' \
--data-urlencode 'grant_type=client_credentials' \
--data-urlencode 'client_id=6AUMmEzcmCWtMc1O72gQHnVhrIUR11gs' \
--data-urlencode 'client_secret=dxNnovSaR6S2yJw4HKfi2nSWRaOLA7pykqcokOAJHXGsj24GSV25qN106z5MWOA5' \
--data-urlencode 'audience=http://localfood.fun”'

```

You will need to enable the client for the API in the Auth0 dashboard, I got “service not enabled” but the curl command above works.

It would be a good idea to create a new Client or rotate the secret on the existing client since the ID and secret were shared publicly.

Hope this helps!

---

<div class="post-metadata">

**Author:** ![konrad.sopala](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/konrad.sopala/32/13516_2.png) [@konrad.sopala](https://community.auth0.com/u/konrad.sopala)\
**Post date:** [October 15, 2021, 8:59am UTC](https://community.auth0.com/t/curl-6-could-not-resolve-host/71355/3 "2021-10-15T08:59:06Z")

</div>

Thanks for helping on this one Marcus!

---

<div class="post-metadata">

**Author:** ![konrad.sopala](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/konrad.sopala/32/13516_2.png) [@konrad.sopala](https://community.auth0.com/u/konrad.sopala)\
**Post date:** [October 28, 2021, 12:55pm UTC](https://community.auth0.com/t/curl-6-could-not-resolve-host/71355/4 "2021-10-28T12:55:10Z")

</div>


