# dkim_dns_set_nslist()

[back to index]

SYNOPSIS

    #include <dkim.h>
    int dkim_dns_set_nslist(
    	DKIM_LIB *libopendkim,
            int (*func)(void *, const char *)
    );

Declares the function to be used by a libopendkim instance when it needs to replace the set of nameservers used by a DNS resolver. By default, a stub function that configures the standard system resolver (when supported) is set.

The function will be passed the following arguments:

1. A pointer to a handle that refers to the instantiated resolver service, via a prior call to to the initialization function defined by `dkim_dns_set_init()`.
2. A pointer to NULL-terminated, comma-separated list of nameservers to be used. The underlying implementation may not use all of the ones provided as it might have a fixed limit. Consult your resolver's documentation.

The function is expected to return one of the following:

- `DKIM_DNS_SUCCESS` -- query was successfully canceled
- `DKIM_DNS_ERROR` -- an error occurred

DESCRIPTION

Called When | `dkim_dns_set_nslist()` can be called at any time, but is presumably most useful prior to doing any DNS operations such as are done during `dkim_eoh()` when verifying. The function will be called implicitly if no service handle has been stored and a query is ready to be started.

ARGUMENTS

Argument | Description
--- | ---
libopendkim | The library instantiation handle, returned by `dkim_init()`.
func | A pointer to a function that should be used to change the list of nameservers to be queried by the DNS resolver.

RETURN VALUES

- `DKIM_DNS_SUCCESS` -- successful operation
- `DKIM_DNS_ERROR` -- an error occurred

NOTES

- None.

Copyright (c) 2007 Sendmail, Inc. and its suppliers. All rights reserved.
Copyright (c) 2012, The Trusted Domain Project. All rights reserved.
By using this file, you agree to the terms and conditions set forth in the respective licenses.