summaryrefslogtreecommitdiff
path: root/libcli/dns
AgeCommit message (Collapse)AuthorFilesLines
2019-05-25lib: Only compile resolvconftest if fmemopen existsVolker Lendecke1-0/+1
Bug: https://bugzilla.samba.org/show_bug.cgi?id=13961 Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Ralph Böhme <slow@samba.org> Autobuild-User(master): Jeremy Allison <jra@samba.org> Autobuild-Date(master): Sat May 25 00:05:25 UTC 2019 on sn-devel-184
2019-04-09lib: Initialize variables in parse_resolvconf_fpVolker Lendecke1-3/+3
Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Stefan Metzmacher <metze@samba.org>
2019-04-09lib: Initialize getline() argumentsVolker Lendecke1-1/+1
Keep "len" valid across the loop iterations for getline to consume Bug: https://bugzilla.samba.org/show_bug.cgi?id=13892 Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Stefan Metzmacher <metze@samba.org>
2019-01-25Fix tests when building with selftest but without developerIsaac Boukris1-1/+1
Signed-off-by: Isaac Boukris <iboukris@gmail.com> Reviewed-by: Ralph Boehme <slow@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org> Autobuild-User(master): Ralph Böhme <slow@samba.org> Autobuild-Date(master): Fri Jan 25 21:57:57 CET 2019 on sn-devel-144
2019-01-22libcli: dns: Change internal DNS_REQUEST_TIMEOUT from 2 to 10 seconds.Jeremy Allison1-1/+1
Should make us more robust when dealing with slow DNS servers. Signed-off-by: Jeremy Allison <jra@samba.org> Reviewed-by: Volker Lendecke <vl@samba.org> Autobuild-User(master): Jeremy Allison <jra@samba.org> Autobuild-Date(master): Tue Jan 22 23:37:16 CET 2019 on sn-devel-144
2019-01-15libcli/dns: Add dns_res_rec_get_sockaddrVolker Lendecke2-0/+40
Pull the address from a res_rec if it's there Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
2019-01-15libcli/dns: clidns must depend on ndr_standard, not on NDR_DNSVolker Lendecke1-1/+1
Otherwise we can't link this into other libraries Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
2019-01-15libcli/dns: Make "clidns" a libraryVolker Lendecke1-2/+3
This will be linked into the SAMBA_LIBRARY "addns" in the next step. Because the other user, "dnsserver_common", is also a library, we can't link this as a subsystem anymore. Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
2019-01-15dns_lookup: Let make test override the resolv.conf locationVolker Lendecke1-1/+12
Make this a separate commit: That is the feature that libc unfortunately does not give us. Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
2019-01-15libcli/dns: Add dns_lookupVolker Lendecke4-0/+435
Wrapper function to parse resolv.conf and talk to multiple nameservers. This is the code where we might want to add a "working nameserver" cache. glibc always looks at the first configured nameserver. If that's dead, glibc runs into a timeout and only then asks the second one that might succeed. When more than one dns query is to be performed, these timeouts add up. Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
2019-01-15libcli/dns: Add resolv.conf parsingVolker Lendecke4-1/+248
Right now this only looks at the nameserver setting. It is initally made for asynchronous AD DC lookup routines, where we don't need the "search", "domain" and other settings. When we convert general "net", "smbclient" and others to use this, we might either add "domain" handling to this code or look at something like c-ares which already does it. Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
2018-04-24tevent: Fix callers of tevent_req_set_endtimeVolker Lendecke1-1/+0
tevent_req_set_endtime internally already calls tevent_req_nomem and thus sets the error status correctly. Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
2018-01-06dnscli: Make a few functions staticVolker Lendecke2-56/+18
We might want to use the tcp flavor in the future in the forwarder for a single, persistent TCP connection. Then we can easily re-publish it. Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Andreas Schneider <asn@samba.org>
2018-01-04libdns: Add dns_cli_requestVolker Lendecke3-2/+209
First UDP, then TCP if truncation happened Signed-off-by: Volker Lendecke <vl@samba.org>
2018-01-04libdns: dns/tcp clientVolker Lendecke2-0/+229
Same signature as the UDP client in the same file. This opens and closes the socket per request. In the future, we might want to create a persistent TCP connection for our internal DNS server's forwarder. That will require proper handling of in-flight requests. Something for another day. Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
2018-01-04libdns: Fix a typoVolker Lendecke1-1/+1
Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
2017-01-11wscript: remove executable bits for all wscript* filesStefan Metzmacher1-0/+0
These files should not be executable. Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Volker Lendecke <vl@samba.org> Autobuild-User(master): Volker Lendecke <vl@samba.org> Autobuild-Date(master): Wed Jan 11 20:21:01 CET 2017 on sn-devel-144
2015-12-08libdns: Small cleanupVolker Lendecke1-2/+0
Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
2015-12-08libdns: Convert dns_udp_request to 0/errnoVolker Lendecke2-21/+20
Replaces 5 calls to unix_to_werror with just one Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
2015-12-08libdns: Properly set ENOMEMVolker Lendecke1-0/+1
Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
2015-12-08libdns: tsocket returns -1 and sets errnoVolker Lendecke1-3/+3
Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
2014-12-18libcli-dns: Remove obsolete dns_host_file subsystem.Andreas Schneider3-450/+0
Autobuild-User(master): Andrew Bartlett <abartlet@samba.org> Autobuild-Date(master): Thu Dec 18 09:09:38 CET 2014 on sn-devel-104
2014-09-28libcli: Remove unreachable code in dns_hosts_file.Andreas Schneider1-2/+0
The count is already checked for 0 above this line so it can never be 0 at this point. Signed-off-by: Andreas Schneider <asn@samba.org> Reviewed-by: Michael Adam <obnox@samba.org>
2014-08-26libcli/dns: ignore NS entries in dns_hosts_file.c at a higher log level for nowStefan Metzmacher1-0/+12
Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2014-08-26libcli/dns: add AAAA support to dns_hosts_file.cStefan Metzmacher1-7/+16
Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2012-10-16libcli/dns: Time out requests after a whileKai Blin1-0/+8
Time out UDP requests after DNS_REQUEST_TIMEOUT seconds. Currently set to 2 seconds. This should fix bug #8878. Signed-off-by: Jeremy Allison <jra@samba.org> Autobuild-User(master): Jeremy Allison <jra@samba.org> Autobuild-Date(master): Tue Oct 16 12:58:32 CEST 2012 on sn-devel-104
2012-05-30libcli/dns: Rename UDP-based calls to reflect their useKai Blin1-6/+6
Autobuild-User: Kai Blin <kai@samba.org> Autobuild-Date: Wed May 30 02:35:27 CEST 2012 on sn-devel-104
2012-05-25dns_hosts_file: move to a separate subsystemAlexander Bokovoy1-5/+7
After discussion with Kai move dns_hosts_file to a separate subsystem and merge it into libaddns private library for s3/s4 client use. Also remove dependency in libcli/nbt, the code from libcli/dns subsystems is not used there at all. Autobuild-User: Alexander Bokovoy <ab@samba.org> Autobuild-Date: Fri May 25 22:22:44 CEST 2012 on sn-devel-104
2012-05-23libcli/dns: make 'clidns' private library out of DNS code in WAF buildAlexander Bokovoy1-7/+5
After consolidating DNS resolver code to lib/addns, there is one piece that still needs to be moved into a common DNS resolver library: DNS_HOSTS_FILE subsystem. Unfortunately, direct move would require lib/addns to depend on libcli/util/{ntstatus.h,werror.h} (provided by errors subsystem). In addition, moving libcli/dns/* code to lib/addns/ would make conflicting the dns_tkey_record struct. The conflict comes from source4/dns_server/ and is due to use of IDL to define the struct. lib/addns/ library also provides its own definition so we either need to keep them in sync (rewrite code in lib/addns/ a bit) or depend on generated IDL headers. Thus, making a private library and subsystem clidns is an intermediate step that allows to buy some time fore refactoring.
2012-05-23Move source3/libads/dns.c to lib/addnsSimo Sorce1-0/+4
2012-03-27s4 dns: Add a simple async client libraryKai Blin3-0/+230
2011-04-26libcli/dns Improve dns_hosts_file, using Samba3's struct dns_rr_srvAndrew Bartlett2-0/+483
By reworking the 'fake DNS' file to use struct dns_rr_srv it should be possible to emulate that resolver layer as well as the Samba4 sockaddr_storage* based layer. This will then give us a common DNS emulation for 'make test'. Andrew Bartlett