NextDNS api is working on Express backend but not on React frontend.

I'm calling NextDNS api from Postman and Express and they are working good.

But the same code from React frontend got error "authRequired".

I correctly set x-api-key to header.

Could you tell me what's wrong?

3 replies

    • Sukka
    • 10 mths ago
    • Reported - view

    It seems that NextDNS API is explicitly blocking their API endpoint being called from the front end.

    Any requests to the NextDNS API endpoint with the `Origin` request header sent will always return the `authRequired`.

      • David.9
      • 10 mths ago
      • Reported - view

       is there a way to call nextdns api from frontend?

      • Sukka
      • 10 mths ago
      • Reported - view

      The only workaround would be self-hosting a reverse proxy that can exclude the `Origin` header to the NextDNS API endpoint. Using any third-party reverse proxy server will potentially leak your NextDNS API Key.


      To be honest, I have stopped using NextDNS immediately and I recommend you consider doing likewise. Given that it has been five months since your original posts without any response from the staff (until I encountered the same issue, dug a little deeper, and found out their dark secret), I'm compelled to surmise that NextDNS believes this is the intended behavior. In short, NextDNS is deliberately faking API error responses.

      Should a DNS company intentionally fake API error responses indicating a normal request is `authRequired`, it is only a matter of time before they begin to fake/alter DNS responses.

Content aside

  • 10 mths agoLast active
  • 3Replies
  • 241Views
  • 2 Following