getdnsapi / getdns

A modern asynchronous DNS API https://getdnsapi.net/
Other
465 stars 126 forks source link

Set Upstream By Name #273

Open huitema opened 7 years ago

huitema commented 7 years ago

The current API for setting the upstream involve creating a DICT and a LIST containing a bunch of address and port values. How about adding an API that just take the name of the upstream server? The API would resolve that name in the default context, obtain the addresses, and configure the address in the service.

Among the bonus options: 1) Open multiple upstreams for each of the server address found in the DNS; 2) Or, just open one upstream for the first server address; 3) Maybe an asynchronous implementation, with a call back when the server is ready;

wtoorop commented 7 years ago

Quick report from discussing this with Sara.

The lookup of the names should be done with the OS provided name servers. We initialize upstreams with these when context is created with set_from_OS set to 1. Perhaps we should initialize a separate set of upstreams with OS defaults always. This can be copied to the context default upstreams when set_from_OS was 1, and can also be used to resolve resolvers-IP by name.

huitema commented 7 years ago

This is exactly what I did for the hackathon. The code is in https://github.com/huitema/GetDnsHacks.