Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

89
Vistas
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 la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda