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

98
Visualizações
nginx - dns resolution in njs

I need to solve a simple DNS query using njs in nginx.

I've searched but it seems that there isn't a 'native' function for doing this.

So I'm trying to use dns-lookup module for node.js I've installed it using npm install dns-lookup, then I've tried to use it in my njs script, with something like:

var lookup = require('dns-lookup');
ip = lookup.resolve(hostname);

But when I run this script I receive an error:

[error] 13555#13555: *124 js exception: Error: Cannot find module "dns-lookup"

1st question, is it right what I'm doing? How can I load an external module in my js file?

2nd question, do you know how to solve? And/or is there a better way for do a DNS resolution?

I've found a similar question here in stackoverflow but without answers

Thanks in advance

over 4 years ago · Santiago Trujillo
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