Add "options no_tld_query" to resolv.conf.
Mention the capability in resolver(5). Mention that RES_OPTIONS can be used in resolver(5). Discussed with: -hackers
This commit is contained in:
parent
6856ba1262
commit
a367bd9e25
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=28982
@ -53,7 +53,7 @@
|
|||||||
*
|
*
|
||||||
* @(#)resolv.h 8.1 (Berkeley) 6/2/93
|
* @(#)resolv.h 8.1 (Berkeley) 6/2/93
|
||||||
* From Id: resolv.h,v 8.18 1997/06/01 20:34:32 vixie Exp
|
* From Id: resolv.h,v 8.18 1997/06/01 20:34:32 vixie Exp
|
||||||
* $Id: resolv.h,v 1.12 1997/05/07 20:00:10 eivind Exp $
|
* $Id: resolv.h,v 1.13 1997/06/27 08:32:38 peter Exp $
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifndef _RESOLV_H_
|
#ifndef _RESOLV_H_
|
||||||
@ -135,6 +135,7 @@ struct __res_state {
|
|||||||
#define RES_INSECURE2 0x00000800 /* type 2 security disabled */
|
#define RES_INSECURE2 0x00000800 /* type 2 security disabled */
|
||||||
#define RES_NOALIASES 0x00001000 /* shuts off HOSTALIASES feature */
|
#define RES_NOALIASES 0x00001000 /* shuts off HOSTALIASES feature */
|
||||||
#define RES_USE_INET6 0x00002000 /* use/map IPv6 in gethostbyname() */
|
#define RES_USE_INET6 0x00002000 /* use/map IPv6 in gethostbyname() */
|
||||||
|
#define RES_NOTLDQUERY 0x00004000 /* Don't query TLD names */
|
||||||
|
|
||||||
#define RES_DEFAULT (RES_RECURSE | RES_DEFNAMES | RES_DNSRCH)
|
#define RES_DEFAULT (RES_RECURSE | RES_DEFNAMES | RES_DNSRCH)
|
||||||
|
|
||||||
|
@ -56,7 +56,7 @@
|
|||||||
#if defined(LIBC_SCCS) && !defined(lint)
|
#if defined(LIBC_SCCS) && !defined(lint)
|
||||||
static char sccsid[] = "@(#)res_init.c 8.1 (Berkeley) 6/7/93";
|
static char sccsid[] = "@(#)res_init.c 8.1 (Berkeley) 6/7/93";
|
||||||
static char orig_rcsid[] = "From: Id: res_init.c,v 8.8 1997/06/01 20:34:37 vixie Exp";
|
static char orig_rcsid[] = "From: Id: res_init.c,v 8.8 1997/06/01 20:34:37 vixie Exp";
|
||||||
static char rcsid[] = "$Id: res_init.c,v 1.12 1997/02/22 15:00:32 peter Exp $";
|
static char rcsid[] = "$Id: res_init.c,v 1.13 1997/06/27 08:22:03 peter Exp $";
|
||||||
#endif /* LIBC_SCCS and not lint */
|
#endif /* LIBC_SCCS and not lint */
|
||||||
|
|
||||||
#include <sys/types.h>
|
#include <sys/types.h>
|
||||||
@ -424,6 +424,8 @@ res_setoptions(options, source)
|
|||||||
#endif
|
#endif
|
||||||
} else if (!strncmp(cp, "inet6", sizeof("inet6") - 1)) {
|
} else if (!strncmp(cp, "inet6", sizeof("inet6") - 1)) {
|
||||||
_res.options |= RES_USE_INET6;
|
_res.options |= RES_USE_INET6;
|
||||||
|
} else if (!strncmp(cp, "no_tld_query", sizeof("no_tld_query") - 1)) {
|
||||||
|
_res.options |= RES_NOTLDQUERY;
|
||||||
} else {
|
} else {
|
||||||
/* XXX - print a warning here? */
|
/* XXX - print a warning here? */
|
||||||
}
|
}
|
||||||
|
@ -56,7 +56,7 @@
|
|||||||
#if defined(LIBC_SCCS) && !defined(lint)
|
#if defined(LIBC_SCCS) && !defined(lint)
|
||||||
static char sccsid[] = "@(#)res_query.c 8.1 (Berkeley) 6/4/93";
|
static char sccsid[] = "@(#)res_query.c 8.1 (Berkeley) 6/4/93";
|
||||||
static char orig_rcsid = "From: Id: res_query.c,v 8.10 1997/06/01 20:34:37 vixie Exp";
|
static char orig_rcsid = "From: Id: res_query.c,v 8.10 1997/06/01 20:34:37 vixie Exp";
|
||||||
static char rcsid[] = "$Id: res_query.c,v 1.13 1997/03/24 06:11:44 imp Exp $";
|
static char rcsid[] = "$Id: res_query.c,v 1.14 1997/06/27 08:22:03 peter Exp $";
|
||||||
#endif /* LIBC_SCCS and not lint */
|
#endif /* LIBC_SCCS and not lint */
|
||||||
|
|
||||||
#include <sys/types.h>
|
#include <sys/types.h>
|
||||||
@ -281,9 +281,9 @@ res_search(name, class, type, answer, anslen)
|
|||||||
|
|
||||||
/* if we have not already tried the name "as is", do that now.
|
/* if we have not already tried the name "as is", do that now.
|
||||||
* note that we do this regardless of how many dots were in the
|
* note that we do this regardless of how many dots were in the
|
||||||
* name or whether it ends with a dot.
|
* name or whether it ends with a dot unless NOTLDQUERY is set.
|
||||||
*/
|
*/
|
||||||
if (!tried_as_is) {
|
if (!tried_as_is && (dots || !(_res.options & RES_NOTLDQUERY))) {
|
||||||
ret = res_querydomain(name, NULL, class, type, answer, anslen);
|
ret = res_querydomain(name, NULL, class, type, answer, anslen);
|
||||||
if (ret > 0)
|
if (ret > 0)
|
||||||
return (ret);
|
return (ret);
|
||||||
|
@ -30,7 +30,7 @@
|
|||||||
.\" SUCH DAMAGE.
|
.\" SUCH DAMAGE.
|
||||||
.\"
|
.\"
|
||||||
.\" @(#)resolver.5 8.1 (Berkeley) 6/5/93
|
.\" @(#)resolver.5 8.1 (Berkeley) 6/5/93
|
||||||
.\" $Id: resolver.5,v 1.3 1997/03/07 03:28:05 jmg Exp $
|
.\" $Id: resolver.5,v 1.4 1997/05/15 20:05:16 peter Exp $
|
||||||
.\"
|
.\"
|
||||||
.Dd November 11, 1993
|
.Dd November 11, 1993
|
||||||
.Dt RESOLVER 5
|
.Dt RESOLVER 5
|
||||||
@ -116,17 +116,16 @@ e.g. sortlist 130.155.160.0/255.255.240.0 130.155.0.0
|
|||||||
Options allows certain internal resolver variables to be modified.
|
Options allows certain internal resolver variables to be modified.
|
||||||
The syntax is
|
The syntax is
|
||||||
.Pp
|
.Pp
|
||||||
-\fBoptions\fP \fIoption\fP \fI...\fP
|
\fBoptions\fP \fIoption\fP \fI...\fP
|
||||||
.Pp
|
.Pp
|
||||||
where
|
where
|
||||||
.Sy option
|
.Sy option
|
||||||
is one of the following:
|
is one of the following:
|
||||||
.Pp
|
.Pp
|
||||||
.Bl -tag -width nameserver
|
.Bl -tag -width no_tld_query
|
||||||
.It Sy debug
|
.It Sy debug
|
||||||
sets
|
sets
|
||||||
.Dv
|
.Dv RES_DEBUG
|
||||||
RES_DEBUG
|
|
||||||
in _res.options.
|
in _res.options.
|
||||||
.It Sy ndots:n
|
.It Sy ndots:n
|
||||||
sets a threshold for the number of dots which must appear in a name given to
|
sets a threshold for the number of dots which must appear in a name given to
|
||||||
@ -143,13 +142,19 @@ meaning that if there are any dots in a name, the name
|
|||||||
will be tried first as an absolute name before any
|
will be tried first as an absolute name before any
|
||||||
.Em search list
|
.Em search list
|
||||||
elements are appended to it.
|
elements are appended to it.
|
||||||
.Pp
|
.It Sy no_tld_query
|
||||||
The
|
tells the resolver not to attempt to resolve a top level domain name, that
|
||||||
|
is, a name that contains no dots. Use of this option doesn't prevent
|
||||||
|
the resolver from obeying the standard
|
||||||
.Sy domain
|
.Sy domain
|
||||||
and
|
and
|
||||||
.Sy search
|
.Sy search
|
||||||
keywords are mutually exclusive.
|
rules with the given name.
|
||||||
.El
|
.El
|
||||||
|
.Pp
|
||||||
|
Options may also be specified as a space or tab separated list using the
|
||||||
|
.Dv RES_OPTIONS
|
||||||
|
environment variable.
|
||||||
.El
|
.El
|
||||||
.Pp
|
.Pp
|
||||||
The
|
The
|
||||||
|
Loading…
Reference in New Issue
Block a user