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]);
