xtd 0.2.0
Loading...
Searching...
No Matches
dns_get_host_entry.cpp

Shows how to use xtd::net::dns class.

#include <xtd/net/dns>
#include <xtd/console>
using namespace xtd;
using namespace xtd::net;
auto main() -> int {
auto host_entry = dns::get_host_entry("www.github.com");
console::write_line("ip host entry for : www.github.com");
console::write_line(" - host_name : {}", host_entry.host_name());
console::write_line(" - address list :");
for (auto address : host_entry.address_list())
console::write_line(" * {}", address);
console::write_line(" - aliases :");
for (auto alias : host_entry.aliases())
console::write_line(" * {}", alias);
}
// This code produces the following output :
//
// ip host entry for : www.github.com
// - host_name : github.com
// - address list :
// * 140.82.121.3
// - aliases :
// * www.github.com
The xtd::net namespace provides a simple programming interface for many of the protocols used on netw...
Definition cookie_exception.hpp:11
The xtd namespace contains all fundamental classes to access Hardware, Os, System,...
Definition xtd_about_box.hpp:10