[#LookupHost-09]
= LookupHost
:mrdocs:

Resolve a host string to its first corresponding network address&period;

== Synopsis

Declared in `&lt;netbase&period;h&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
std::optional&lt;CNetAddr&gt;
LookupHost(
    std::string const& name,
    bool fAllowLookup,
    xref:DNSLookupFn.adoc[DNSLookupFn] dns&lowbar;lookup&lowbar;function = g&lowbar;dns&lowbar;lookup);
----

== Return Value

The resulting network address to which the specified host string resolved or std&colon;&colon;nullopt if host does not resolve to an address&period;

== Parameters

[cols="1,4"]
|===
| Name| Description
| *name*
| The host name or numeric address to resolve&period;
| *fAllowLookup*
| Whether DNS lookups are permitted&period;
| *dns&lowbar;lookup&lowbar;function*
| The resolver used to perform the lookup&period;
|===

== See Also

LookupHost(const std&colon;&colon;string&amp;, unsigned int, bool, DNSLookupFn) for additional parameter descriptions&period;


[.small]#Created with https://www.mrdocs.com[MrDocs]#
