1

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

null
    • Sukka
    • 7 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
      • 7 mths ago
      • Reported - view

       is there a way to call nextdns api from frontend?

      • Sukka
      • 7 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

  • 1 Likes
  • 7 mths agoLast active
  • 3Replies
  • 232Views
  • 2 Following