[#Lookup-04]
= Lookup
:mrdocs:

Resolve a service string to its corresponding service&period;

== Synopsis

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

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

== Return Value

The resulting services to which the specified service string resolved&period;

== Parameters

[cols="1,4"]
|===
| Name| Description
| *name*
| The string representing a service&period; Could be a name or a numerical IP address (IPv6 addresses should be in their disambiguated bracketed form), optionally followed by a uint16&lowbar;t port number&period; (e&period;g&period; example&period;com&colon;8333 or &lsqb;2001&colon;db8&colon;85a3&colon;8d3&colon;1319&colon;8a2e&colon;370&colon;7348&rsqb;&colon;420)
| *portDefault*
| The default port for resulting services if not specified by the service string&period;
| *fAllowLookup*
| Whether or not hostname lookups are permitted&period; If yes, external queries may be performed&period;
| *nMaxSolutions*
| The maximum number of results we want, specifying 0 means &quot;as many solutions as we get&period;&quot;
| *dns&lowbar;lookup&lowbar;function*
| The resolver used to perform the lookup&period;
|===


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