val_res_query(), val_res_search() − DNSSEC−validated
resolution of DNS queries

  #include <validator/validator.h>

  int val_res_query(const val_context_t *ctx,
                    const char *dname,
                    int class,
                    int type,
                    unsigned char *answer,
                    int anslen,
                    val_status_t *val_status);

  int val_res_search(val_context_t * ctx,
            const char *dname,
            int class_h,
            int type,
            unsigned char * answer,
            int anslen,
            val_status_t * val_status);

The val_res_query() function performs DNSSEC validation of
DNS queries.  It is a DNSSEC‐aware substitute for the
res_query(3) legacy function.  val_res_search() performs an
operation similar to val_res_query().  In addition, it uses
the search paths specified within the /etc/resolv.conf file
to create the fully qualified domain name.  val_res_search()
is a DNSSEC‐aware substitute for the res_search(3) function.

     The ctx parameter is the validator context and can be
set to NULL for default settings.  More information about
this field can be found in libval(3).

     The dname parameter specifies the domain name, class
specifies the DNS class and type specifies the DNS type.

     The validation status values for val_res_query() and
val_res_search() functions are returned in their respective
val_status fields.  p_val_status() returns a brief string
description of the error code.  val_istrusted() determines
if the status code indicates that the response can be
trusted and val_isvalidated() determines if the status code
indicates that the response was validated.  (See libval(3)
for further information).

val_res_query() and val_res_search() return the number of
bytes received on success and −1 on failure.

Copyright 2004−2013 SPARTA, Inc.  All rights reserved.  See
the COPYING file included with the DNSSEC‐Tools package for


Abhijit Hayatnagarkar, Suresh Krishnaswamy, Robert Story.


     get_context(3), val_getaddrinfo(3),