about summary refs log tree commit diff
path: root/src/network/res_querydomain.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/network/res_querydomain.c')
-rw-r--r--src/network/res_querydomain.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/src/network/res_querydomain.c b/src/network/res_querydomain.c
new file mode 100644
index 00000000..c746dbe6
--- /dev/null
+++ b/src/network/res_querydomain.c
@@ -0,0 +1,14 @@
+#include <resolv.h>
+#include <string.h>
+
+int res_querydomain(const char *name, const char *domain, int class, int type, unsigned char *dest, int len)
+{
+	char tmp[256];
+	size_t nl = strnlen(name, 256);
+	size_t dl = strnlen(domain, 256);
+	if (nl+dl+1 > 255) return -1;
+	memcpy(tmp, name, nl);
+	tmp[nl] = '.';
+	memcpy(tmp+nl+1, domain, dl+1);
+	return res_query(tmp, class, type, dest, len);
+}