#include <userver/clients/dns/resolver.hpp>
Caching DNS resolver implementation.
Usually retrieved from clients::dns::Component.
Combines file-based (/etc/hosts) name resolution with network-based one.
Definition at line 26 of file resolver.hpp.
Classes | |
struct | LookupSourceCounters |
Public Member Functions | |
Resolver (engine::TaskProcessor &fs_task_processor, const ResolverConfig &config) | |
Resolver (const Resolver &)=delete | |
Resolver (Resolver &&)=delete | |
AddrVector | Resolve (const std::string &name, engine::Deadline deadline) |
const LookupSourceCounters & | GetLookupSourceCounters () const |
Returns lookup source counters. | |
void | ReloadHosts () |
Forces the reload of lookup table file. Waits until the reload is done. | |
void | FlushNetworkCache () |
Resets the network results cache. | |
void | FlushNetworkCache (const std::string &name) |
Removes the specified domain name from the network results cache. | |
AddrVector clients::dns::Resolver::Resolve | ( | const std::string & | name, |
engine::Deadline | deadline ) |
Performs a domain name resolution.
Sources are tried in the following order:
clients::dns::NotResolvedException | if none of the sources provide a result within the specified deadline. |