Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

292
Visualizações
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 Respostas
Responde à pergunta

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 Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda