:right-sidebar: True Resolver =================================================================== .. currentmodule:: gi.repository.Gio .. class:: Resolver(**properties: ~typing.Any) :no-contents-entry: Superclasses: :class:`~gi.repository.GObject.Object` Subclasses: :class:`~gi.repository.Gio.ThreadedResolver` The object that handles DNS resolution. Use :obj:`~gi.repository.Gio.Resolver.get_default` to get the default resolver. ``GResolver`` provides cancellable synchronous and asynchronous DNS resolution, for hostnames (:obj:`~gi.repository.Gio.Resolver.lookup_by_address`\, :obj:`~gi.repository.Gio.Resolver.lookup_by_name` and their async variants) and SRV (service) records (:obj:`~gi.repository.Gio.Resolver.lookup_service`\). :obj:`~gi.repository.Gio.NetworkAddress` and :obj:`~gi.repository.Gio.NetworkService` provide wrappers around ``GResolver`` functionality that also implement :obj:`~gi.repository.Gio.SocketConnectable`\, making it easy to connect to a remote host/service. The default resolver (see :obj:`~gi.repository.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. Methods ------- .. rst-class:: interim-class .. class:: Resolver :no-index: .. method:: do_lookup_by_address(self, address: ~gi.repository.Gio.InetAddress, cancellable: ~gi.repository.Gio.Cancellable | None = None) -> str :param address: :param cancellable: .. method:: do_lookup_by_address_async(self, address: ~gi.repository.Gio.InetAddress, cancellable: ~gi.repository.Gio.Cancellable | None = None, callback: ~typing.Callable[[~gi.repository.GObject.Object | None, ~gi.repository.Gio.AsyncResult, ~typing.Any], None] | None = None, user_data: ~typing.Any = None) -> None :param address: :param cancellable: :param callback: :param user_data: .. method:: do_lookup_by_address_finish(self, result: ~gi.repository.Gio.AsyncResult) -> str :param result: .. method:: do_lookup_by_name(self, hostname: str, cancellable: ~gi.repository.Gio.Cancellable | None = None) -> list[~gi.repository.Gio.InetAddress] :param hostname: :param cancellable: .. method:: do_lookup_by_name_async(self, hostname: str, cancellable: ~gi.repository.Gio.Cancellable | None = None, callback: ~typing.Callable[[~gi.repository.GObject.Object | None, ~gi.repository.Gio.AsyncResult, ~typing.Any], None] | None = None, user_data: ~typing.Any = None) -> None :param hostname: :param cancellable: :param callback: :param user_data: .. method:: do_lookup_by_name_finish(self, result: ~gi.repository.Gio.AsyncResult) -> list[~gi.repository.Gio.InetAddress] :param result: .. method:: do_lookup_by_name_with_flags(self, hostname: str, flags: ~gi.repository.Gio.ResolverNameLookupFlags, cancellable: ~gi.repository.Gio.Cancellable | None = None) -> list[~gi.repository.Gio.InetAddress] :param hostname: :param flags: :param cancellable: .. method:: do_lookup_by_name_with_flags_async(self, hostname: str, flags: ~gi.repository.Gio.ResolverNameLookupFlags, cancellable: ~gi.repository.Gio.Cancellable | None = None, callback: ~typing.Callable[[~gi.repository.GObject.Object | None, ~gi.repository.Gio.AsyncResult, ~typing.Any], None] | None = None, user_data: ~typing.Any = None) -> None :param hostname: :param flags: :param cancellable: :param callback: :param user_data: .. method:: do_lookup_by_name_with_flags_finish(self, result: ~gi.repository.Gio.AsyncResult) -> list[~gi.repository.Gio.InetAddress] :param result: .. method:: do_lookup_records(self, rrname: str, record_type: ~gi.repository.Gio.ResolverRecordType, cancellable: ~gi.repository.Gio.Cancellable | None = None) -> list[~gi.repository.GLib.Variant] :param rrname: :param record_type: :param cancellable: .. method:: do_lookup_records_async(self, rrname: str, record_type: ~gi.repository.Gio.ResolverRecordType, cancellable: ~gi.repository.Gio.Cancellable | None = None, callback: ~typing.Callable[[~gi.repository.GObject.Object | None, ~gi.repository.Gio.AsyncResult, ~typing.Any], None] | None = None, user_data: ~typing.Any = None) -> None :param rrname: :param record_type: :param cancellable: :param callback: :param user_data: .. method:: do_lookup_records_finish(self, result: ~gi.repository.Gio.AsyncResult) -> list[~gi.repository.GLib.Variant] :param result: .. method:: do_lookup_service_async(self, rrname: str, cancellable: ~gi.repository.Gio.Cancellable | None = None, callback: ~typing.Callable[[~gi.repository.GObject.Object | None, ~gi.repository.Gio.AsyncResult, ~typing.Any], None] | None = None, user_data: ~typing.Any = None) -> None :param rrname: :param cancellable: :param callback: :param user_data: .. method:: do_lookup_service_finish(self, result: ~gi.repository.Gio.AsyncResult) -> list[~gi.repository.Gio.SrvTarget] :param result: .. method:: do_reload(self) -> None .. classmethod:: get_default() -> ~gi.repository.Gio.Resolver Gets the default :obj:`~gi.repository.Gio.Resolver`\. You should unref it when you are done with it. :obj:`~gi.repository.Gio.Resolver` may use its reference count as a hint about how many threads it should allocate for concurrent DNS resolutions. .. versionadded:: 2.22 .. method:: get_timeout() -> int Get the timeout applied to all resolver lookups. See :obj:`~gi.repository.Gio.Resolver`\:timeout. .. versionadded:: 2.78 .. method:: lookup_by_address(address: ~gi.repository.Gio.InetAddress, cancellable: ~gi.repository.Gio.Cancellable | None = None) -> str Synchronously reverse-resolves ``address`` to determine its associated hostname. If the DNS resolution fails, ``error`` (if non-:const:`None`) will be set to a value from ``GResolverError``. If ``cancellable`` is non-:const:`None`, it can be used to cancel the operation, in which case ``error`` (if non-:const:`None`) will be set to :const:`~gi.repository.Gio.IOErrorEnum.CANCELLED`. .. versionadded:: 2.22 :param address: the address to reverse-resolve :param cancellable: a :obj:`~gi.repository.Gio.Cancellable`\, or :const:`None` .. method:: lookup_by_address_async(address: ~gi.repository.Gio.InetAddress, cancellable: ~gi.repository.Gio.Cancellable | None = None, callback: ~typing.Callable[[~gi.repository.GObject.Object | None, ~gi.repository.Gio.AsyncResult, ~typing.Any], None] | None = None, user_data: ~typing.Any = None) -> None Begins asynchronously reverse-resolving ``address`` to determine its associated hostname, and eventually calls ``callback``\, which must call :func:`~gi.repository.Gio.Resolver.lookup_by_address_finish` to get the final result. .. versionadded:: 2.22 :param address: the address to reverse-resolve :param cancellable: a :obj:`~gi.repository.Gio.Cancellable`\, or :const:`None` :param callback: callback to call after resolution completes :param user_data: data for ``callback`` .. method:: lookup_by_address_finish(result: ~gi.repository.Gio.AsyncResult) -> str Retrieves the result of a previous call to :func:`~gi.repository.Gio.Resolver.lookup_by_address_async`. If the DNS resolution failed, ``error`` (if non-:const:`None`) will be set to a value from ``GResolverError``. If the operation was cancelled, ``error`` will be set to :const:`~gi.repository.Gio.IOErrorEnum.CANCELLED`. .. versionadded:: 2.22 :param result: the result passed to your :obj:`~gi.repository.Gio.AsyncReadyCallback` .. method:: lookup_by_name(hostname: str, cancellable: ~gi.repository.Gio.Cancellable | None = None) -> list[~gi.repository.Gio.InetAddress] 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 :func:`~gi.repository.Gio.InetAddress.new_from_string`). On success, :func:`~gi.repository.Gio.Resolver.lookup_by_name` will return a non-empty :obj:`~gi.repository.GLib.List` of :obj:`~gi.repository.Gio.InetAddress`\, sorted in order of preference and guaranteed to not contain duplicates. That is, if using the result to connect to ``hostname``\, you should attempt to connect to the first address first, then the second if the first fails, etc. If you are using the result to listen on a socket, it is appropriate to add each result using e.g. :func:`~gi.repository.Gio.SocketListener.add_address`. If the DNS resolution fails, ``error`` (if non-:const:`None`) will be set to a value from ``GResolverError`` and :const:`None` will be returned. If ``cancellable`` is non-:const:`None`, it can be used to cancel the operation, in which case ``error`` (if non-:const:`None`) will be set to :const:`~gi.repository.Gio.IOErrorEnum.CANCELLED`. If you are planning to connect to a socket on the resolved IP address, it may be easier to create a :obj:`~gi.repository.Gio.NetworkAddress` and use its :obj:`~gi.repository.Gio.SocketConnectable` interface. .. versionadded:: 2.22 :param hostname: the hostname to look up :param cancellable: a :obj:`~gi.repository.Gio.Cancellable`\, or :const:`None` .. method:: lookup_by_name_async(hostname: str, cancellable: ~gi.repository.Gio.Cancellable | None = None, callback: ~typing.Callable[[~gi.repository.GObject.Object | None, ~gi.repository.Gio.AsyncResult, ~typing.Any], None] | None = None, user_data: ~typing.Any = None) -> None Begins asynchronously resolving ``hostname`` to determine its associated IP address(es), and eventually calls ``callback``\, which must call :func:`~gi.repository.Gio.Resolver.lookup_by_name_finish` to get the result. See :func:`~gi.repository.Gio.Resolver.lookup_by_name` for more details. .. versionadded:: 2.22 :param hostname: the hostname to look up the address of :param cancellable: a :obj:`~gi.repository.Gio.Cancellable`\, or :const:`None` :param callback: callback to call after resolution completes :param user_data: data for ``callback`` .. method:: lookup_by_name_finish(result: ~gi.repository.Gio.AsyncResult) -> list[~gi.repository.Gio.InetAddress] Retrieves the result of a call to :func:`~gi.repository.Gio.Resolver.lookup_by_name_async`. If the DNS resolution failed, ``error`` (if non-:const:`None`) will be set to a value from ``GResolverError``. If the operation was cancelled, ``error`` will be set to :const:`~gi.repository.Gio.IOErrorEnum.CANCELLED`. .. versionadded:: 2.22 :param result: the result passed to your :obj:`~gi.repository.Gio.AsyncReadyCallback` .. method:: lookup_by_name_with_flags(hostname: str, flags: ~gi.repository.Gio.ResolverNameLookupFlags, cancellable: ~gi.repository.Gio.Cancellable | None = None) -> list[~gi.repository.Gio.InetAddress] This differs from :func:`~gi.repository.Gio.Resolver.lookup_by_name` in that you can modify the lookup behavior with ``flags``\. For example this can be used to limit results with :const:`~gi.repository.Gio.ResolverNameLookupFlags.IPV4_ONLY`. .. versionadded:: 2.60 :param hostname: the hostname to look up :param flags: extra :obj:`~gi.repository.Gio.ResolverNameLookupFlags` for the lookup :param cancellable: a :obj:`~gi.repository.Gio.Cancellable`\, or :const:`None` .. method:: lookup_by_name_with_flags_async(hostname: str, flags: ~gi.repository.Gio.ResolverNameLookupFlags, cancellable: ~gi.repository.Gio.Cancellable | None = None, callback: ~typing.Callable[[~gi.repository.GObject.Object | None, ~gi.repository.Gio.AsyncResult, ~typing.Any], None] | None = None, user_data: ~typing.Any = None) -> None Begins asynchronously resolving ``hostname`` to determine its associated IP address(es), and eventually calls ``callback``\, which must call :func:`~gi.repository.Gio.Resolver.lookup_by_name_with_flags_finish` to get the result. See :func:`~gi.repository.Gio.Resolver.lookup_by_name` for more details. .. versionadded:: 2.60 :param hostname: the hostname to look up the address of :param flags: extra :obj:`~gi.repository.Gio.ResolverNameLookupFlags` for the lookup :param cancellable: a :obj:`~gi.repository.Gio.Cancellable`\, or :const:`None` :param callback: callback to call after resolution completes :param user_data: data for ``callback`` .. method:: lookup_by_name_with_flags_finish(result: ~gi.repository.Gio.AsyncResult) -> list[~gi.repository.Gio.InetAddress] Retrieves the result of a call to :func:`~gi.repository.Gio.Resolver.lookup_by_name_with_flags_async`. If the DNS resolution failed, ``error`` (if non-:const:`None`) will be set to a value from ``GResolverError``. If the operation was cancelled, ``error`` will be set to :const:`~gi.repository.Gio.IOErrorEnum.CANCELLED`. .. versionadded:: 2.60 :param result: the result passed to your :obj:`~gi.repository.Gio.AsyncReadyCallback` .. method:: lookup_records(rrname: str, record_type: ~gi.repository.Gio.ResolverRecordType, cancellable: ~gi.repository.Gio.Cancellable | None = None) -> list[~gi.repository.GLib.Variant] Synchronously performs a DNS record lookup for the given ``rrname`` and returns a list of records as :obj:`~gi.repository.GLib.Variant` tuples. See :obj:`~gi.repository.Gio.ResolverRecordType` for information on what the records contain for each ``record_type``\. If the DNS resolution fails, ``error`` (if non-:const:`None`) will be set to a value from ``GResolverError`` and :const:`None` will be returned. If ``cancellable`` is non-:const:`None`, it can be used to cancel the operation, in which case ``error`` (if non-:const:`None`) will be set to :const:`~gi.repository.Gio.IOErrorEnum.CANCELLED`. .. versionadded:: 2.34 :param rrname: the DNS name to look up the record for :param record_type: the type of DNS record to look up :param cancellable: a :obj:`~gi.repository.Gio.Cancellable`\, or :const:`None` .. method:: lookup_records_async(rrname: str, record_type: ~gi.repository.Gio.ResolverRecordType, cancellable: ~gi.repository.Gio.Cancellable | None = None, callback: ~typing.Callable[[~gi.repository.GObject.Object | None, ~gi.repository.Gio.AsyncResult, ~typing.Any], None] | None = None, user_data: ~typing.Any = None) -> None Begins asynchronously performing a DNS lookup for the given ``rrname``\, and eventually calls ``callback``\, which must call :func:`~gi.repository.Gio.Resolver.lookup_records_finish` to get the final result. See :func:`~gi.repository.Gio.Resolver.lookup_records` for more details. .. versionadded:: 2.34 :param rrname: the DNS name to look up the record for :param record_type: the type of DNS record to look up :param cancellable: a :obj:`~gi.repository.Gio.Cancellable`\, or :const:`None` :param callback: callback to call after resolution completes :param user_data: data for ``callback`` .. method:: lookup_records_finish(result: ~gi.repository.Gio.AsyncResult) -> list[~gi.repository.GLib.Variant] Retrieves the result of a previous call to :func:`~gi.repository.Gio.Resolver.lookup_records_async`. Returns a non-empty list of records as :obj:`~gi.repository.GLib.Variant` tuples. See :obj:`~gi.repository.Gio.ResolverRecordType` for information on what the records contain. If the DNS resolution failed, ``error`` (if non-:const:`None`) will be set to a value from ``GResolverError``. If the operation was cancelled, ``error`` will be set to :const:`~gi.repository.Gio.IOErrorEnum.CANCELLED`. .. versionadded:: 2.34 :param result: the result passed to your :obj:`~gi.repository.Gio.AsyncReadyCallback` .. method:: lookup_service(service: str, protocol: str, domain: str, cancellable: ~gi.repository.Gio.Cancellable | None = None) -> list[~gi.repository.Gio.SrvTarget] Synchronously performs a DNS SRV lookup for the given ``service`` and ``protocol`` in the given ``domain`` and returns an array of :obj:`~gi.repository.Gio.SrvTarget`\. ``domain`` may be an ASCII-only or UTF-8 hostname. Note also that the ``service`` and ``protocol`` arguments do not include the leading underscore that appears in the actual DNS entry. On success, :func:`~gi.repository.Gio.Resolver.lookup_service` will return a non-empty :obj:`~gi.repository.GLib.List` of :obj:`~gi.repository.Gio.SrvTarget`\, sorted in order of preference. (That is, you should attempt to connect to the first target first, then the second if the first fails, etc.) If the DNS resolution fails, ``error`` (if non-:const:`None`) will be set to a value from ``GResolverError`` and :const:`None` will be returned. If ``cancellable`` is non-:const:`None`, it can be used to cancel the operation, in which case ``error`` (if non-:const:`None`) will be set to :const:`~gi.repository.Gio.IOErrorEnum.CANCELLED`. If you are planning to connect to the service, it is usually easier to create a :obj:`~gi.repository.Gio.NetworkService` and use its :obj:`~gi.repository.Gio.SocketConnectable` interface. .. versionadded:: 2.22 :param service: the service type to look up (eg, "ldap") :param protocol: the networking protocol to use for ``service`` (eg, "tcp") :param domain: the DNS domain to look up the service in :param cancellable: a :obj:`~gi.repository.Gio.Cancellable`\, or :const:`None` .. method:: lookup_service_async(service: str, protocol: str, domain: str, cancellable: ~gi.repository.Gio.Cancellable | None = None, callback: ~typing.Callable[[~gi.repository.GObject.Object | None, ~gi.repository.Gio.AsyncResult, ~typing.Any], None] | None = None, user_data: ~typing.Any = None) -> None Begins asynchronously performing a DNS SRV lookup for the given ``service`` and ``protocol`` in the given ``domain``\, and eventually calls ``callback``\, which must call :func:`~gi.repository.Gio.Resolver.lookup_service_finish` to get the final result. See :func:`~gi.repository.Gio.Resolver.lookup_service` for more details. .. versionadded:: 2.22 :param service: the service type to look up (eg, "ldap") :param protocol: the networking protocol to use for ``service`` (eg, "tcp") :param domain: the DNS domain to look up the service in :param cancellable: a :obj:`~gi.repository.Gio.Cancellable`\, or :const:`None` :param callback: callback to call after resolution completes :param user_data: data for ``callback`` .. method:: lookup_service_finish(result: ~gi.repository.Gio.AsyncResult) -> list[~gi.repository.Gio.SrvTarget] Retrieves the result of a previous call to :func:`~gi.repository.Gio.Resolver.lookup_service_async`. If the DNS resolution failed, ``error`` (if non-:const:`None`) will be set to a value from ``GResolverError``. If the operation was cancelled, ``error`` will be set to :const:`~gi.repository.Gio.IOErrorEnum.CANCELLED`. .. versionadded:: 2.22 :param result: the result passed to your :obj:`~gi.repository.Gio.AsyncReadyCallback` .. method:: set_default() -> None Sets ``resolver`` to be the application's default resolver (reffing ``resolver``\, and unreffing the previous default resolver, if any). Future calls to :func:`~gi.repository.Gio.Resolver.get_default` will return this resolver. This can be used if an application wants to perform any sort of DNS caching or "pinning"; it can implement its own :obj:`~gi.repository.Gio.Resolver` that calls the original default resolver for DNS operations, and implements its own cache policies on top of that, and then set itself as the default resolver for all later code to use. .. versionadded:: 2.22 .. method:: set_timeout(timeout_ms: int) -> None Set the timeout applied to all resolver lookups. See :obj:`~gi.repository.Gio.Resolver`\:timeout. .. versionadded:: 2.78 :param timeout_ms: timeout in milliseconds, or ``0`` for no timeouts Properties ---------- .. rst-class:: interim-class .. class:: Resolver :no-index: .. attribute:: props.timeout :type: int The type of the None singleton. .. versionadded:: 2.78 Signals ------- .. rst-class:: interim-class .. class:: Resolver.signals :no-index: .. method:: reload() -> None The type of the None singleton. Virtual Methods --------------- .. rst-class:: interim-class .. class:: Resolver :no-index: .. method:: do_lookup_by_address(address: ~gi.repository.Gio.InetAddress, cancellable: ~gi.repository.Gio.Cancellable | None = None) -> str Synchronously reverse-resolves ``address`` to determine its associated hostname. If the DNS resolution fails, ``error`` (if non-:const:`None`) will be set to a value from ``GResolverError``. If ``cancellable`` is non-:const:`None`, it can be used to cancel the operation, in which case ``error`` (if non-:const:`None`) will be set to :const:`~gi.repository.Gio.IOErrorEnum.CANCELLED`. .. versionadded:: 2.22 :param address: the address to reverse-resolve :param cancellable: a :obj:`~gi.repository.Gio.Cancellable`\, or :const:`None` .. method:: do_lookup_by_address_async(address: ~gi.repository.Gio.InetAddress, cancellable: ~gi.repository.Gio.Cancellable | None = None, callback: ~typing.Callable[[~gi.repository.GObject.Object | None, ~gi.repository.Gio.AsyncResult, ~typing.Any], None] | None = None, user_data: ~typing.Any = None) -> None Begins asynchronously reverse-resolving ``address`` to determine its associated hostname, and eventually calls ``callback``\, which must call :func:`~gi.repository.Gio.Resolver.lookup_by_address_finish` to get the final result. .. versionadded:: 2.22 :param address: the address to reverse-resolve :param cancellable: a :obj:`~gi.repository.Gio.Cancellable`\, or :const:`None` :param callback: callback to call after resolution completes :param user_data: data for ``callback`` .. method:: do_lookup_by_address_finish(result: ~gi.repository.Gio.AsyncResult) -> str Retrieves the result of a previous call to :func:`~gi.repository.Gio.Resolver.lookup_by_address_async`. If the DNS resolution failed, ``error`` (if non-:const:`None`) will be set to a value from ``GResolverError``. If the operation was cancelled, ``error`` will be set to :const:`~gi.repository.Gio.IOErrorEnum.CANCELLED`. .. versionadded:: 2.22 :param result: the result passed to your :obj:`~gi.repository.Gio.AsyncReadyCallback` .. method:: do_lookup_by_name(hostname: str, cancellable: ~gi.repository.Gio.Cancellable | None = None) -> list[~gi.repository.Gio.InetAddress] 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 :func:`~gi.repository.Gio.InetAddress.new_from_string`). On success, :func:`~gi.repository.Gio.Resolver.lookup_by_name` will return a non-empty :obj:`~gi.repository.GLib.List` of :obj:`~gi.repository.Gio.InetAddress`\, sorted in order of preference and guaranteed to not contain duplicates. That is, if using the result to connect to ``hostname``\, you should attempt to connect to the first address first, then the second if the first fails, etc. If you are using the result to listen on a socket, it is appropriate to add each result using e.g. :func:`~gi.repository.Gio.SocketListener.add_address`. If the DNS resolution fails, ``error`` (if non-:const:`None`) will be set to a value from ``GResolverError`` and :const:`None` will be returned. If ``cancellable`` is non-:const:`None`, it can be used to cancel the operation, in which case ``error`` (if non-:const:`None`) will be set to :const:`~gi.repository.Gio.IOErrorEnum.CANCELLED`. If you are planning to connect to a socket on the resolved IP address, it may be easier to create a :obj:`~gi.repository.Gio.NetworkAddress` and use its :obj:`~gi.repository.Gio.SocketConnectable` interface. .. versionadded:: 2.22 :param hostname: the hostname to look up :param cancellable: a :obj:`~gi.repository.Gio.Cancellable`\, or :const:`None` .. method:: do_lookup_by_name_async(hostname: str, cancellable: ~gi.repository.Gio.Cancellable | None = None, callback: ~typing.Callable[[~gi.repository.GObject.Object | None, ~gi.repository.Gio.AsyncResult, ~typing.Any], None] | None = None, user_data: ~typing.Any = None) -> None Begins asynchronously resolving ``hostname`` to determine its associated IP address(es), and eventually calls ``callback``\, which must call :func:`~gi.repository.Gio.Resolver.lookup_by_name_finish` to get the result. See :func:`~gi.repository.Gio.Resolver.lookup_by_name` for more details. .. versionadded:: 2.22 :param hostname: the hostname to look up the address of :param cancellable: a :obj:`~gi.repository.Gio.Cancellable`\, or :const:`None` :param callback: callback to call after resolution completes :param user_data: data for ``callback`` .. method:: do_lookup_by_name_finish(result: ~gi.repository.Gio.AsyncResult) -> list[~gi.repository.Gio.InetAddress] Retrieves the result of a call to :func:`~gi.repository.Gio.Resolver.lookup_by_name_async`. If the DNS resolution failed, ``error`` (if non-:const:`None`) will be set to a value from ``GResolverError``. If the operation was cancelled, ``error`` will be set to :const:`~gi.repository.Gio.IOErrorEnum.CANCELLED`. .. versionadded:: 2.22 :param result: the result passed to your :obj:`~gi.repository.Gio.AsyncReadyCallback` .. method:: do_lookup_by_name_with_flags(hostname: str, flags: ~gi.repository.Gio.ResolverNameLookupFlags, cancellable: ~gi.repository.Gio.Cancellable | None = None) -> list[~gi.repository.Gio.InetAddress] This differs from :func:`~gi.repository.Gio.Resolver.lookup_by_name` in that you can modify the lookup behavior with ``flags``\. For example this can be used to limit results with :const:`~gi.repository.Gio.ResolverNameLookupFlags.IPV4_ONLY`. .. versionadded:: 2.60 :param hostname: the hostname to look up :param flags: extra :obj:`~gi.repository.Gio.ResolverNameLookupFlags` for the lookup :param cancellable: a :obj:`~gi.repository.Gio.Cancellable`\, or :const:`None` .. method:: do_lookup_by_name_with_flags_async(hostname: str, flags: ~gi.repository.Gio.ResolverNameLookupFlags, cancellable: ~gi.repository.Gio.Cancellable | None = None, callback: ~typing.Callable[[~gi.repository.GObject.Object | None, ~gi.repository.Gio.AsyncResult, ~typing.Any], None] | None = None, user_data: ~typing.Any = None) -> None Begins asynchronously resolving ``hostname`` to determine its associated IP address(es), and eventually calls ``callback``\, which must call :func:`~gi.repository.Gio.Resolver.lookup_by_name_with_flags_finish` to get the result. See :func:`~gi.repository.Gio.Resolver.lookup_by_name` for more details. .. versionadded:: 2.60 :param hostname: the hostname to look up the address of :param flags: extra :obj:`~gi.repository.Gio.ResolverNameLookupFlags` for the lookup :param cancellable: a :obj:`~gi.repository.Gio.Cancellable`\, or :const:`None` :param callback: callback to call after resolution completes :param user_data: data for ``callback`` .. method:: do_lookup_by_name_with_flags_finish(result: ~gi.repository.Gio.AsyncResult) -> list[~gi.repository.Gio.InetAddress] Retrieves the result of a call to :func:`~gi.repository.Gio.Resolver.lookup_by_name_with_flags_async`. If the DNS resolution failed, ``error`` (if non-:const:`None`) will be set to a value from ``GResolverError``. If the operation was cancelled, ``error`` will be set to :const:`~gi.repository.Gio.IOErrorEnum.CANCELLED`. .. versionadded:: 2.60 :param result: the result passed to your :obj:`~gi.repository.Gio.AsyncReadyCallback` .. method:: do_lookup_records(rrname: str, record_type: ~gi.repository.Gio.ResolverRecordType, cancellable: ~gi.repository.Gio.Cancellable | None = None) -> list[~gi.repository.GLib.Variant] Synchronously performs a DNS record lookup for the given ``rrname`` and returns a list of records as :obj:`~gi.repository.GLib.Variant` tuples. See :obj:`~gi.repository.Gio.ResolverRecordType` for information on what the records contain for each ``record_type``\. If the DNS resolution fails, ``error`` (if non-:const:`None`) will be set to a value from ``GResolverError`` and :const:`None` will be returned. If ``cancellable`` is non-:const:`None`, it can be used to cancel the operation, in which case ``error`` (if non-:const:`None`) will be set to :const:`~gi.repository.Gio.IOErrorEnum.CANCELLED`. .. versionadded:: 2.34 :param rrname: the DNS name to look up the record for :param record_type: the type of DNS record to look up :param cancellable: a :obj:`~gi.repository.Gio.Cancellable`\, or :const:`None` .. method:: do_lookup_records_async(rrname: str, record_type: ~gi.repository.Gio.ResolverRecordType, cancellable: ~gi.repository.Gio.Cancellable | None = None, callback: ~typing.Callable[[~gi.repository.GObject.Object | None, ~gi.repository.Gio.AsyncResult, ~typing.Any], None] | None = None, user_data: ~typing.Any = None) -> None Begins asynchronously performing a DNS lookup for the given ``rrname``\, and eventually calls ``callback``\, which must call :func:`~gi.repository.Gio.Resolver.lookup_records_finish` to get the final result. See :func:`~gi.repository.Gio.Resolver.lookup_records` for more details. .. versionadded:: 2.34 :param rrname: the DNS name to look up the record for :param record_type: the type of DNS record to look up :param cancellable: a :obj:`~gi.repository.Gio.Cancellable`\, or :const:`None` :param callback: callback to call after resolution completes :param user_data: data for ``callback`` .. method:: do_lookup_records_finish(result: ~gi.repository.Gio.AsyncResult) -> list[~gi.repository.GLib.Variant] Retrieves the result of a previous call to :func:`~gi.repository.Gio.Resolver.lookup_records_async`. Returns a non-empty list of records as :obj:`~gi.repository.GLib.Variant` tuples. See :obj:`~gi.repository.Gio.ResolverRecordType` for information on what the records contain. If the DNS resolution failed, ``error`` (if non-:const:`None`) will be set to a value from ``GResolverError``. If the operation was cancelled, ``error`` will be set to :const:`~gi.repository.Gio.IOErrorEnum.CANCELLED`. .. versionadded:: 2.34 :param result: the result passed to your :obj:`~gi.repository.Gio.AsyncReadyCallback` .. method:: do_lookup_service_async(rrname: str, cancellable: ~gi.repository.Gio.Cancellable | None = None, callback: ~typing.Callable[[~gi.repository.GObject.Object | None, ~gi.repository.Gio.AsyncResult, ~typing.Any], None] | None = None, user_data: ~typing.Any = None) -> None :param rrname: :param cancellable: :param callback: :param user_data: .. method:: do_lookup_service_finish(result: ~gi.repository.Gio.AsyncResult) -> list[~gi.repository.Gio.SrvTarget] Retrieves the result of a previous call to :func:`~gi.repository.Gio.Resolver.lookup_service_async`. If the DNS resolution failed, ``error`` (if non-:const:`None`) will be set to a value from ``GResolverError``. If the operation was cancelled, ``error`` will be set to :const:`~gi.repository.Gio.IOErrorEnum.CANCELLED`. .. versionadded:: 2.22 :param result: the result passed to your :obj:`~gi.repository.Gio.AsyncReadyCallback` .. method:: do_reload() -> None The type of the None singleton. Fields ------ .. rst-class:: interim-class .. class:: Resolver :no-index: .. attribute:: parent_instance .. attribute:: priv