NT_STATUS_EQUAL(last_dns_status,NT_STATUS_CONNECTION_REFUSED)) &&
(last_dns_check+DNS_FAILED_WAITTIME) > now )
{
- DEBUG(10,("last_dns_check: Returning cached status (%s)\n",
+ DEBUG(10,("dns_send_req: last dns check returning cached status (%s)\n",
nt_errstr(last_dns_status) ));
return last_dns_status;
}
if (buf_len) {
if ((buffer = talloc_array(ctx, uint8_t, buf_len))
== NULL ) {
- DEBUG(0,("ads_dns_lookup_srv: "
+ DEBUG(0,("dns_send_req: "
"talloc() failed!\n"));
last_dns_status = NT_STATUS_NO_MEMORY;
last_dns_check = time_mono(NULL);
if ((resp_len = res_query(name, C_IN, q_type, buffer, buf_len))
< 0 ) {
- DEBUG(3,("ads_dns_lookup_srv: "
+ DEBUG(3,("dns_send_req: "
"Failed to resolve %s (%s)\n",
name, strerror(errno)));
TALLOC_FREE( buffer );
Simple wrapper for a DNS SRV query
*********************************************************************/
-static NTSTATUS ads_dns_lookup_srv( TALLOC_CTX *ctx,
- const char *dns_hosts_file,
+NTSTATUS ads_dns_lookup_srv(TALLOC_CTX *ctx,
const char *name,
struct dns_rr_srv **dclist,
int *numdcs)
return NT_STATUS_INVALID_PARAMETER;
}
- if (dns_hosts_file) {
- return resolve_dns_hosts_file_as_dns_rr(dns_hosts_file,
- name, true, ctx,
- dclist, numdcs);
- }
-
/* Send the request. May have to loop several times in case
of large replies */
*********************************************************************/
NTSTATUS ads_dns_lookup_ns(TALLOC_CTX *ctx,
- const char *dns_hosts_file,
const char *dnsdomain,
struct dns_rr_ns **nslist,
int *numns)
return NT_STATUS_INVALID_PARAMETER;
}
- if (dns_hosts_file) {
- DEBUG(1, ("NO 'NS' lookup available when using resolv:host file"));
- return NT_STATUS_OBJECT_NAME_NOT_FOUND;
- }
-
/* Send the request. May have to loop several times in case
of large replies */
********************************************************************/
static NTSTATUS ads_dns_query_internal(TALLOC_CTX *ctx,
- const char *dns_hosts_file,
const char *servicename,
const char *dc_pdc_gc_domains,
const char *realm,
if (!name) {
return NT_STATUS_NO_MEMORY;
}
- return ads_dns_lookup_srv(ctx, dns_hosts_file, name, dclist, numdcs);
+ return ads_dns_lookup_srv(ctx, name, dclist, numdcs);
}
/********************************************************************
********************************************************************/
NTSTATUS ads_dns_query_dcs(TALLOC_CTX *ctx,
- const char *dns_hosts_file,
const char *realm,
const char *sitename,
struct dns_rr_srv **dclist,
{
NTSTATUS status;
- status = ads_dns_query_internal(ctx, dns_hosts_file, "_ldap", "dc",
- realm, sitename, dclist, numdcs);
+ status = ads_dns_query_internal(ctx,
+ "_ldap",
+ "dc",
+ realm,
+ sitename,
+ dclist,
+ numdcs);
if (NT_STATUS_EQUAL(status, NT_STATUS_IO_TIMEOUT) ||
NT_STATUS_EQUAL(status, NT_STATUS_CONNECTION_REFUSED)) {
((!NT_STATUS_IS_OK(status)) ||
(NT_STATUS_IS_OK(status) && (numdcs == 0)))) {
/* Sitename DNS query may have failed. Try without. */
- status = ads_dns_query_internal(ctx, dns_hosts_file,
- "_ldap", "dc", realm,
- NULL, dclist, numdcs);
+ status = ads_dns_query_internal(ctx,
+ "_ldap",
+ "dc",
+ realm,
+ NULL,
+ dclist,
+ numdcs);
}
return status;
}
********************************************************************/
NTSTATUS ads_dns_query_gcs(TALLOC_CTX *ctx,
- const char *dns_hosts_file,
const char *realm,
const char *sitename,
struct dns_rr_srv **dclist,
{
NTSTATUS status;
- status = ads_dns_query_internal(ctx, dns_hosts_file, "_ldap", "gc",
- realm, sitename, dclist, numdcs);
+ status = ads_dns_query_internal(ctx,
+ "_ldap",
+ "gc",
+ realm,
+ sitename,
+ dclist,
+ numdcs);
if (NT_STATUS_EQUAL(status, NT_STATUS_IO_TIMEOUT) ||
NT_STATUS_EQUAL(status, NT_STATUS_CONNECTION_REFUSED)) {
((!NT_STATUS_IS_OK(status)) ||
(NT_STATUS_IS_OK(status) && (numdcs == 0)))) {
/* Sitename DNS query may have failed. Try without. */
- status = ads_dns_query_internal(ctx, dns_hosts_file,
- "_ldap", "gc", realm,
- NULL, dclist, numdcs);
+ status = ads_dns_query_internal(ctx,
+ "_ldap",
+ "gc",
+ realm,
+ NULL,
+ dclist,
+ numdcs);
}
return status;
}
********************************************************************/
NTSTATUS ads_dns_query_kdcs(TALLOC_CTX *ctx,
- const char *dns_hosts_file,
const char *dns_forest_name,
const char *sitename,
struct dns_rr_srv **dclist,
{
NTSTATUS status;
- status = ads_dns_query_internal(ctx, dns_hosts_file, "_kerberos", "dc",
- dns_forest_name, sitename, dclist,
+ status = ads_dns_query_internal(ctx,
+ "_kerberos",
+ "dc",
+ dns_forest_name,
+ sitename,
+ dclist,
numdcs);
if (NT_STATUS_EQUAL(status, NT_STATUS_IO_TIMEOUT) ||
((!NT_STATUS_IS_OK(status)) ||
(NT_STATUS_IS_OK(status) && (numdcs == 0)))) {
/* Sitename DNS query may have failed. Try without. */
- status = ads_dns_query_internal(ctx, dns_hosts_file,
- "_kerberos", "dc",
- dns_forest_name, NULL,
- dclist, numdcs);
+ status = ads_dns_query_internal(ctx,
+ "_kerberos",
+ "dc",
+ dns_forest_name,
+ NULL,
+ dclist,
+ numdcs);
}
return status;
}
********************************************************************/
NTSTATUS ads_dns_query_pdc(TALLOC_CTX *ctx,
- const char *dns_hosts_file,
const char *dns_domain_name,
struct dns_rr_srv **dclist,
int *numdcs )
{
- return ads_dns_query_internal(ctx, dns_hosts_file, "_ldap", "pdc",
- dns_domain_name, NULL, dclist, numdcs);
+ return ads_dns_query_internal(ctx,
+ "_ldap",
+ "pdc",
+ dns_domain_name,
+ NULL,
+ dclist,
+ numdcs);
}
/********************************************************************
********************************************************************/
NTSTATUS ads_dns_query_dcs_guid(TALLOC_CTX *ctx,
- const char *dns_hosts_file,
const char *dns_forest_name,
const char *domain_guid,
struct dns_rr_srv **dclist,
return NT_STATUS_NO_MEMORY;
}
- return ads_dns_query_internal(ctx, dns_hosts_file, "_ldap", domains,
- dns_forest_name, NULL, dclist, numdcs);
+ return ads_dns_query_internal(ctx,
+ "_ldap",
+ domains,
+ dns_forest_name,
+ NULL,
+ dclist,
+ numdcs);
}