Reads and stores DNS configuration from a file or an input stream. More...
#include <resolver.hpp>
Public Member Functions | |
| TResolvConf (const std::string &fn="/etc/resolv.conf") | |
| Constructs a TResolvConf and loads DNS configuration from a file. | |
| TResolvConf (std::istream &input) | |
| Constructs a TResolvConf from an input stream. | |
Public Attributes | |
| std::vector< TAddress > | Nameservers |
| A vector of nameserver addresses. | |
Reads and stores DNS configuration from a file or an input stream.
This class loads a list of nameservers from a DNS configuration file (by default, /etc/resolv.conf) or from any other input stream. The nameservers are stored as a vector of TAddress objects.
| NNet::TResolvConf::TResolvConf | ( | const std::string & | fn = "/etc/resolv.conf" | ) |
Constructs a TResolvConf and loads DNS configuration from a file.
| fn | Path to the DNS configuration file. Default is "/etc/resolv.conf". |
| NNet::TResolvConf::TResolvConf | ( | std::istream & | input | ) |
Constructs a TResolvConf from an input stream.
This constructor allows loading the DNS configuration from any standard input stream.
| input | Reference to an input stream containing DNS configuration data. |
| std::vector<TAddress> NNet::TResolvConf::Nameservers |
A vector of nameserver addresses.
These addresses are extracted from the configuration source.