Resolver
The object that handles DNS resolution. Use func@Gio.Resolver.get_default to get the default resolver.
GResolver
provides cancellable synchronous and asynchronous DNS resolution, for hostnames (method@Gio.Resolver.lookup_by_address, method@Gio.Resolver.lookup_by_name and their async variants) and SRV (service) records (method@Gio.Resolver.lookup_service).
class@Gio.NetworkAddress and class@Gio.NetworkService provide wrappers around GResolver
functionality that also implement iface@Gio.SocketConnectable, making it easy to connect to a remote host/service.
The default resolver (see func@Gio.Resolver.get_default) has a timeout of 30s set on it since GLib 2.78. Earlier versions of GLib did not support resolver timeouts.
This is an abstract type; subclasses of it implement different resolvers for different platforms and situations.
Constructors
Functions
Emitted when the resolver notices that the system resolver configuration has changed.
Get the timeout applied to all resolver lookups. See #GResolver:timeout.
Synchronously reverse-resolves @address to determine its associated hostname.
Begins asynchronously reverse-resolving @address to determine its associated hostname, and eventually calls @callback, which must call g_resolver_lookup_by_address_finish() to get the final result.
Retrieves the result of a previous call to g_resolver_lookup_by_address_async().
Synchronously resolves @hostname to determine its associated IP address(es). @hostname may be an ASCII-only or UTF-8 hostname, or the textual form of an IP address (in which case this just becomes a wrapper around g_inet_address_new_from_string()).
Begins asynchronously resolving @hostname to determine its associated IP address(es), and eventually calls @callback, which must call g_resolver_lookup_by_name_finish() to get the result. See g_resolver_lookup_by_name() for more details.
Retrieves the result of a call to g_resolver_lookup_by_name_async().
This differs from g_resolver_lookup_by_name() in that you can modify the lookup behavior with @flags. For example this can be used to limit results with %G_RESOLVER_NAME_LOOKUP_FLAGS_IPV4_ONLY.
Begins asynchronously resolving @hostname to determine its associated IP address(es), and eventually calls @callback, which must call g_resolver_lookup_by_name_with_flags_finish() to get the result. See g_resolver_lookup_by_name() for more details.
Retrieves the result of a call to g_resolver_lookup_by_name_with_flags_async().
Synchronously performs a DNS record lookup for the given @rrname and returns a list of records as #GVariant tuples. See #GResolverRecordType for information on what the records contain for each @record_type.
Begins asynchronously performing a DNS lookup for the given
Retrieves the result of a previous call to g_resolver_lookup_records_async(). Returns a non-empty list of records as #GVariant tuples. See #GResolverRecordType for information on what the records contain.
Synchronously performs a DNS SRV lookup for the given @service and
Begins asynchronously performing a DNS SRV lookup for the given
Retrieves the result of a previous call to g_resolver_lookup_service_async().
Sets @resolver to be the application's default resolver (reffing
Set the timeout applied to all resolver lookups. See #GResolver:timeout.