Saturday 22 June 2019

Setting custom DNS server when using request

I am working on an application that I want to use my local DNS server instead of some public one.​I am using the request package from NPM to send my requests. I would love it to be set a value in my app.js file and then be able to send requests without some hacky code like I have now (not showing... it's that bad)​I tried doing what this page said but it would not work for me.https://nodejs.org/api/dns.html#dns_dns_setservers_servers​I am kind of stuck with the request package from npm for a variety of reasons one of which is the amount of places I use it and a refactor would take quite a bit of time.​My goal is that I can use request and consul DNS to work together so that I can send a DNS request and get back the address of a service and it would include port if needed.​I have ~10 different services running on multiple ports and would like to run multiple instances of the other services using different ports and still be able to send requests to it using the request package from npm

Submitted June 22, 2019 at 08:17PM by jsdfkljdsafdsu980p

No comments:

Post a Comment