diff options
Diffstat (limited to 'source3/libsmb')
-rw-r--r-- | source3/libsmb/dsgetdcname.c | 23 | ||||
-rw-r--r-- | source3/libsmb/namequery.c | 11 |
2 files changed, 23 insertions, 11 deletions
diff --git a/source3/libsmb/dsgetdcname.c b/source3/libsmb/dsgetdcname.c index 05be272450..a690ab49c1 100644 --- a/source3/libsmb/dsgetdcname.c +++ b/source3/libsmb/dsgetdcname.c @@ -546,24 +546,31 @@ static NTSTATUS discover_dc_dns(TALLOC_CTX *mem_ctx, int numaddrs = 0; struct ip_service_name *dclist = NULL; int count = 0; + const char *dns_hosts_file; + dns_hosts_file = lp_parm_const_string(-1, "resolv", "host file", NULL); if (flags & DS_PDC_REQUIRED) { - status = ads_dns_query_pdc(mem_ctx, domain_name, - &dcs, &numdcs); + status = ads_dns_query_pdc(mem_ctx, dns_hosts_file, + domain_name, &dcs, &numdcs); } else if (flags & DS_GC_SERVER_REQUIRED) { - status = ads_dns_query_gcs(mem_ctx, domain_name, site_name, + status = ads_dns_query_gcs(mem_ctx, dns_hosts_file, + domain_name, site_name, &dcs, &numdcs); } else if (flags & DS_KDC_REQUIRED) { - status = ads_dns_query_kdcs(mem_ctx, domain_name, site_name, + status = ads_dns_query_kdcs(mem_ctx, dns_hosts_file, + domain_name, site_name, &dcs, &numdcs); } else if (flags & DS_DIRECTORY_SERVICE_REQUIRED) { - status = ads_dns_query_dcs(mem_ctx, domain_name, site_name, + status = ads_dns_query_dcs(mem_ctx, dns_hosts_file, + domain_name, site_name, &dcs, &numdcs); } else if (domain_guid) { - status = ads_dns_query_dcs_guid(mem_ctx, domain_name, - domain_guid, &dcs, &numdcs); + status = ads_dns_query_dcs_guid(mem_ctx, dns_hosts_file, + domain_name, domain_guid, + &dcs, &numdcs); } else { - status = ads_dns_query_dcs(mem_ctx, domain_name, site_name, + status = ads_dns_query_dcs(mem_ctx, dns_hosts_file, + domain_name, site_name, &dcs, &numdcs); } diff --git a/source3/libsmb/namequery.c b/source3/libsmb/namequery.c index 8934d85243..417464c17e 100644 --- a/source3/libsmb/namequery.c +++ b/source3/libsmb/namequery.c @@ -2424,6 +2424,7 @@ static NTSTATUS resolve_ads(const char *name, struct dns_rr_srv *dcs = NULL; int numdcs = 0; int numaddrs = 0; + const char *dns_hosts_file; if ((name_type != 0x1c) && (name_type != KDC_NAME_TYPE) && (name_type != 0x1b)) { @@ -2437,23 +2438,27 @@ static NTSTATUS resolve_ads(const char *name, /* The DNS code needs fixing to find IPv6 addresses... JRA. */ + dns_hosts_file = lp_parm_const_string(-1, "resolv", "host file", NULL); switch (name_type) { case 0x1b: DEBUG(5,("resolve_ads: Attempting to resolve " "PDC for %s using DNS\n", name)); - status = ads_dns_query_pdc(ctx, name, &dcs, &numdcs); + status = ads_dns_query_pdc(ctx, dns_hosts_file, + name, &dcs, &numdcs); break; case 0x1c: DEBUG(5,("resolve_ads: Attempting to resolve " "DCs for %s using DNS\n", name)); - status = ads_dns_query_dcs(ctx, name, sitename, &dcs, + status = ads_dns_query_dcs(ctx, dns_hosts_file, + name, sitename, &dcs, &numdcs); break; case KDC_NAME_TYPE: DEBUG(5,("resolve_ads: Attempting to resolve " "KDCs for %s using DNS\n", name)); - status = ads_dns_query_kdcs(ctx, name, sitename, &dcs, + status = ads_dns_query_kdcs(ctx, dns_hosts_file, + name, sitename, &dcs, &numdcs); break; default: |