Gio.Resolver.lookup_records

### Method

# Gio Resolverlookup_records

since: 2.34

#### Declaration [src]

    GList*
    g_resolver_lookup_records (
      GResolver* resolver,
      const gchar* rrname,
      GResolverRecordType record_type,
      GCancellable* cancellable,
      GError** error
    )

#### Description [src]

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`.

If the DNS resolution fails, `error` (if non-`NULL`) will be set to a value from `GResolverError` and `NULL` will be returned.

If `cancellable` is non-`NULL`, it can be used to cancel the operation, in which case `error` (if non-`NULL`) will be set to `G_IO_ERROR_CANCELLED`.

Available since: 2.34

#### Parameters

`rrname`

  Type: `const gchar*`

  The DNS name to look up the record for.

  The data is owned by the caller of the method.
  The value is a NUL terminated UTF-8 string.

`record_type`

  Type: `GResolverRecordType`

  The type of DNS record to look up.

`cancellable`

  Type: `GCancellable`

  A `GCancellable`, or `NULL`.

  The argument can be `NULL`.
  The data is owned by the caller of the method.

`error`

  Type: `GError **`

  The return location for a recoverable error.

  The argument can be `NULL`.
  If the return location is not `NULL`, then you must initialize it to a `NULL` `GError*`.
  The argument will be left initialized to `NULL` by the method if there are no errors.
  In case of error, the argument will be set to a newly allocated `GError`; the caller will take ownership of the data, and be responsible for freeing it.

#### Return value

Type: A list of `GVariant*`

A non-empty `GList` of `GVariant`, or `NULL` on error. You must free each of the records and the list when you are done with it. (You can use `g_list_free_full()` with `g_variant_unref()` to do this.).

The caller of the method takes ownership of the returned data, and is responsible for freeing it.