Index: uspace/app/dnsres/dnsres.c
===================================================================
--- uspace/app/dnsres/dnsres.c	(revision f023251c3aa6327894b6d7424d62f7d2d8581485)
+++ uspace/app/dnsres/dnsres.c	(revision e948fde266f4f69dd0caf033d76df02d962da8f2)
@@ -54,5 +54,5 @@
 	}
 	
-	uint16_t af;
+	uint16_t ver;
 	char *hname;
 	
@@ -63,5 +63,5 @@
 		}
 		
-		af = AF_INET;
+		ver = ip_v4;
 		hname = argv[2];
 	} else if (str_cmp(argv[1], "-6") == 0) {
@@ -71,13 +71,13 @@
 		}
 		
-		af = AF_INET6;
+		ver = ip_v6;
 		hname = argv[2];
 	} else {
-		af = 0;
+		ver = ip_any;
 		hname = argv[1];
 	}
 	
 	dnsr_hostinfo_t *hinfo;
-	int rc = dnsr_name2host(hname, &hinfo, af);
+	int rc = dnsr_name2host(hname, &hinfo, ver);
 	if (rc != EOK) {
 		printf("%s: Error resolving '%s'.\n", NAME, hname);
Index: uspace/app/nettest1/nettest1.c
===================================================================
--- uspace/app/nettest1/nettest1.c	(revision f023251c3aa6327894b6d7424d62f7d2d8581485)
+++ uspace/app/nettest1/nettest1.c	(revision e948fde266f4f69dd0caf033d76df02d962da8f2)
@@ -59,5 +59,5 @@
 #define NETTEST1_TEXT  "Networking test 1 - sockets"
 
-static uint16_t family = AF_INET;
+static uint16_t family = AF_NONE;
 static sock_type_t type = SOCK_DGRAM;
 static size_t size = 27;
@@ -335,5 +335,5 @@
 		/* Interpret as a host name */
 		dnsr_hostinfo_t *hinfo = NULL;
-		rc = dnsr_name2host(addr_s, &hinfo, family);
+		rc = dnsr_name2host(addr_s, &hinfo, ipver_from_af(family));
 		
 		if (rc != EOK) {
@@ -348,4 +348,7 @@
 	struct sockaddr_in6 addr6;
 	uint16_t af = inet_addr_sockaddr_in(&addr_addr, &addr, &addr6);
+	
+	if (family == AF_NONE)
+		family = af;
 	
 	if (af != family) {
Index: uspace/app/nettest2/nettest2.c
===================================================================
--- uspace/app/nettest2/nettest2.c	(revision f023251c3aa6327894b6d7424d62f7d2d8581485)
+++ uspace/app/nettest2/nettest2.c	(revision e948fde266f4f69dd0caf033d76df02d962da8f2)
@@ -60,5 +60,5 @@
 #define NETTEST2_TEXT  "Networking test 2 - transfer"
 
-static uint16_t family = PF_INET;
+static uint16_t family = AF_NONE;
 static size_t size = 28;
 static bool verbose = false;
@@ -271,5 +271,5 @@
 		/* Interpret as a host name */
 		dnsr_hostinfo_t *hinfo = NULL;
-		rc = dnsr_name2host(addr_s, &hinfo, family);
+		rc = dnsr_name2host(addr_s, &hinfo, ipver_from_af(family));
 		
 		if (rc != EOK) {
@@ -284,4 +284,7 @@
 	struct sockaddr_in6 addr6;
 	uint16_t af = inet_addr_sockaddr_in(&addr_addr, &addr, &addr6);
+	
+	if (family == AF_NONE)
+		family = af;
 	
 	if (af != family) {
Index: uspace/app/nettest3/nettest3.c
===================================================================
--- uspace/app/nettest3/nettest3.c	(revision f023251c3aa6327894b6d7424d62f7d2d8581485)
+++ uspace/app/nettest3/nettest3.c	(revision e948fde266f4f69dd0caf033d76df02d962da8f2)
@@ -78,10 +78,10 @@
 		if (rc != EOK) {
 			/* Try interpreting as a host name */
-			rc = dnsr_name2host(argv[1], &hinfo, AF_INET);
+			rc = dnsr_name2host(argv[1], &hinfo, ip_v4);
 			if (rc != EOK) {
 				printf("Error resolving host '%s'.\n", argv[1]);
 				return rc;
 			}
-			
+
 			uint16_t af = inet_addr_sockaddr_in(&hinfo->addr, &addr, NULL);
 			if (af != AF_INET) {
Index: uspace/app/nterm/conn.c
===================================================================
--- uspace/app/nterm/conn.c	(revision f023251c3aa6327894b6d7424d62f7d2d8581485)
+++ uspace/app/nterm/conn.c	(revision e948fde266f4f69dd0caf033d76df02d962da8f2)
@@ -84,5 +84,5 @@
 		/* Interpret as a host name */
 		dnsr_hostinfo_t *hinfo = NULL;
-		rc = dnsr_name2host(addr_s, &hinfo, 0);
+		rc = dnsr_name2host(addr_s, &hinfo, ip_any);
 		
 		if (rc != EOK) {
Index: uspace/app/ping/ping.c
===================================================================
--- uspace/app/ping/ping.c	(revision f023251c3aa6327894b6d7424d62f7d2d8581485)
+++ uspace/app/ping/ping.c	(revision e948fde266f4f69dd0caf033d76df02d962da8f2)
@@ -262,5 +262,5 @@
 	if (rc != EOK) {
 		/* Try interpreting as a host name */
-		rc = dnsr_name2host(argv[optind], &hinfo, AF_INET);
+		rc = dnsr_name2host(argv[optind], &hinfo, ip_v4);
 		if (rc != EOK) {
 			printf("Error resolving host '%s'.\n", argv[optind]);
Index: uspace/app/ping6/ping6.c
===================================================================
--- uspace/app/ping6/ping6.c	(revision f023251c3aa6327894b6d7424d62f7d2d8581485)
+++ uspace/app/ping6/ping6.c	(revision e948fde266f4f69dd0caf033d76df02d962da8f2)
@@ -262,5 +262,5 @@
 	if (rc != EOK) {
 		/* Try interpreting as a host name */
-		rc = dnsr_name2host(argv[optind], &hinfo, AF_INET);
+		rc = dnsr_name2host(argv[optind], &hinfo, ip_v6);
 		if (rc != EOK) {
 			printf("Error resolving host '%s'.\n", argv[optind]);
Index: uspace/lib/c/generic/dnsr.c
===================================================================
--- uspace/lib/c/generic/dnsr.c	(revision f023251c3aa6327894b6d7424d62f7d2d8581485)
+++ uspace/lib/c/generic/dnsr.c	(revision e948fde266f4f69dd0caf033d76df02d962da8f2)
@@ -67,5 +67,5 @@
 }
 
-int dnsr_name2host(const char *name, dnsr_hostinfo_t **rinfo, uint16_t af)
+int dnsr_name2host(const char *name, dnsr_hostinfo_t **rinfo, ip_ver_t ver)
 {
 	dnsr_hostinfo_t *info = calloc(1, sizeof(dnsr_hostinfo_t));
@@ -76,5 +76,5 @@
 	
 	ipc_call_t answer;
-	aid_t req = async_send_1(exch, DNSR_NAME2HOST, (sysarg_t) af,
+	aid_t req = async_send_1(exch, DNSR_NAME2HOST, (sysarg_t) ver,
 	    &answer);
 	
Index: uspace/lib/c/generic/inet/addr.c
===================================================================
--- uspace/lib/c/generic/inet/addr.c	(revision f023251c3aa6327894b6d7424d62f7d2d8581485)
+++ uspace/lib/c/generic/inet/addr.c	(revision e948fde266f4f69dd0caf033d76df02d962da8f2)
@@ -250,4 +250,19 @@
 }
 
+ip_ver_t ipver_from_af(int af)
+{
+	switch (af) {
+	case AF_NONE:
+		return ip_any;
+	case AF_INET:
+		return ip_v4;
+	case AF_INET6:
+		return ip_v6;
+	default:
+		assert(false);
+		return EINVAL;
+	}
+}
+
 void inet_naddr_addr(const inet_naddr_t *naddr, inet_addr_t *addr)
 {
Index: uspace/lib/c/include/inet/addr.h
===================================================================
--- uspace/lib/c/include/inet/addr.h	(revision f023251c3aa6327894b6d7424d62f7d2d8581485)
+++ uspace/lib/c/include/inet/addr.h	(revision e948fde266f4f69dd0caf033d76df02d962da8f2)
@@ -134,4 +134,6 @@
     sockaddr_in6_t *);
 
+extern ip_ver_t ipver_from_af(int af);
+
 #endif
 
Index: uspace/lib/c/include/inet/dnsr.h
===================================================================
--- uspace/lib/c/include/inet/dnsr.h	(revision f023251c3aa6327894b6d7424d62f7d2d8581485)
+++ uspace/lib/c/include/inet/dnsr.h	(revision e948fde266f4f69dd0caf033d76df02d962da8f2)
@@ -51,5 +51,5 @@
 
 extern int dnsr_init(void);
-extern int dnsr_name2host(const char *, dnsr_hostinfo_t **, uint16_t);
+extern int dnsr_name2host(const char *, dnsr_hostinfo_t **, ip_ver_t);
 extern void dnsr_hostinfo_destroy(dnsr_hostinfo_t *);
 extern int dnsr_get_srvaddr(inet_addr_t *);
Index: uspace/lib/http/http.c
===================================================================
--- uspace/lib/http/http.c	(revision f023251c3aa6327894b6d7424d62f7d2d8581485)
+++ uspace/lib/http/http.c	(revision e948fde266f4f69dd0caf033d76df02d962da8f2)
@@ -165,5 +165,5 @@
 		/* Interpret as a host name */
 		dnsr_hostinfo_t *hinfo = NULL;
-		rc = dnsr_name2host(http->host, &hinfo, AF_NONE);
+		rc = dnsr_name2host(http->host, &hinfo, ip_any);
 		
 		if (rc != EOK)
Index: uspace/srv/net/dnsrsrv/dnsrsrv.c
===================================================================
--- uspace/srv/net/dnsrsrv/dnsrsrv.c	(revision f023251c3aa6327894b6d7424d62f7d2d8581485)
+++ uspace/srv/net/dnsrsrv/dnsrsrv.c	(revision e948fde266f4f69dd0caf033d76df02d962da8f2)
@@ -89,5 +89,5 @@
 	log_msg(LOG_DEFAULT, LVL_DEBUG, "inet_get_srvaddr_srv()");
 	
-	uint16_t af = IPC_GET_ARG1(*icall);
+	ip_ver_t ver = IPC_GET_ARG1(*icall);
 	
 	char *name;
@@ -100,5 +100,5 @@
 	
 	dns_host_info_t *hinfo;
-	rc = dns_name2host(name, &hinfo, af);
+	rc = dns_name2host(name, &hinfo, ver);
 	if (rc != EOK) {
 		async_answer_0(iid, rc);
Index: uspace/srv/net/dnsrsrv/query.c
===================================================================
--- uspace/srv/net/dnsrsrv/query.c	(revision f023251c3aa6327894b6d7424d62f7d2d8581485)
+++ uspace/srv/net/dnsrsrv/query.c	(revision e948fde266f4f69dd0caf033d76df02d962da8f2)
@@ -190,5 +190,5 @@
 }
 
-int dns_name2host(const char *name, dns_host_info_t **rinfo, uint16_t af)
+int dns_name2host(const char *name, dns_host_info_t **rinfo, ip_ver_t ver)
 {
 	dns_host_info_t *info = calloc(1, sizeof(dns_host_info_t));
@@ -198,6 +198,6 @@
 	int rc;
 	
-	switch (af) {
-	case AF_NONE:
+	switch (ver) {
+	case ip_any:
 		rc = dns_name_query(name, DTYPE_AAAA, info);
 		
@@ -206,8 +206,8 @@
 		
 		break;
-	case AF_INET:
+	case ip_v4:
 		rc = dns_name_query(name, DTYPE_A, info);
 		break;
-	case AF_INET6:
+	case ip_v6:
 		rc = dns_name_query(name, DTYPE_AAAA, info);
 		break;
Index: uspace/srv/net/dnsrsrv/query.h
===================================================================
--- uspace/srv/net/dnsrsrv/query.h	(revision f023251c3aa6327894b6d7424d62f7d2d8581485)
+++ uspace/srv/net/dnsrsrv/query.h	(revision e948fde266f4f69dd0caf033d76df02d962da8f2)
@@ -37,7 +37,8 @@
 #define QUERY_H
 
+#include <inet/addr.h>
 #include "dns_type.h"
 
-extern int dns_name2host(const char *, dns_host_info_t **, uint16_t);
+extern int dns_name2host(const char *, dns_host_info_t **, ip_ver_t);
 extern void dns_hostinfo_destroy(dns_host_info_t *);
 
