getdns icon indicating copy to clipboard operation
getdns copied to clipboard

Set Upstream By Name

Open huitema opened this issue 8 years ago • 2 comments

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;

huitema avatar Mar 25 '17 19:03 huitema

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.

wtoorop avatar Mar 26 '17 18:03 wtoorop

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

huitema avatar Mar 26 '17 18:03 huitema