[#Lookup-0b]
= Lookup
:mrdocs:

Resolve a service string to its first corresponding service&period;

== Synopsis

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

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

== Return Value

The first resolved service, or std&colon;&colon;nullopt if the string does not resolve&period;

== Parameters

[cols="1,4"]
|===
| Name| Description
| *name*
| The service string to resolve&period;
| *portDefault*
| The port to use when the service string omits one&period;
| *fAllowLookup*
| Whether DNS lookups are permitted&period;
| *dns&lowbar;lookup&lowbar;function*
| The resolver used to perform the lookup&period;
|===

== See Also

Lookup(const std&colon;&colon;string&amp;, uint16&lowbar;t, bool, unsigned int, DNSLookupFn) for additional parameter descriptions&period;


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