Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

300
Views
Is it possible to prevent fake dns blocking (js fetch)

I'm currently working on a website A that is using one of my apis on a website B.

The website A ask the website B some informations and I was thinking that if someone use a fake dns (or put the website B URL in his hosts file), it'll be impossible for my javascript code to get these informations.

Here's my question: is it possible to prevent it or not?

about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

there are multiple ways to prevent that, but not fully.

First, you could perform a dns lookup with javascript as described here.

As another option, you could just use the ip of your target server. But this isn't an ideal solution for production environments.

The third way that comes to mind is a proxy of your api via website A.

While all three of them are not very secure, keep in mind, that a potential user could also modify the client-side javascript code.

Also, welcome to StackOverflow!

about 4 years ago · Juan Pablo Isaza Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!