host

Function

ArgDescriptionType
nameThe name to lookupstring (required)
serverA DNS server to query - if not provided uses the system resolver.string
typeType of lookup, can be CNAME, NS, SOA, TXT, DNSKEY, AXFR, A (default)string
prefer_goPrefer calling the native Go implementation rather than the system.bool

Required permissions:MACHINE_STATE

Description

Perform a DNS resolution.

This function allows DNS to be resolved from within VQL. You can use the regular system resolver (for example on windows will go through the resolver cache service).

You can also specify an external DNS server, causing the query to contact the DNS server for resolving the names.

NOTE: No caching is currently provided so this may generate a lot of load on DNS servers when scanning many rows.

Example

The first query resolves through an external DNS server while the second uses the local resolver.

SELECT host(name='www.google.com', server='8.8.8.8:53'),
   host(name='www.google.com')
FROM scope()