diff --git a/cdist/conf/type/__hostname/explorer/persistent_hostname b/cdist/conf/type/__hostname/explorer/persistent_hostname
index 9ec5639b..8909ebaa 100755
--- a/cdist/conf/type/__hostname/explorer/persistent_hostname
+++ b/cdist/conf/type/__hostname/explorer/persistent_hostname
@@ -43,6 +43,16 @@ in
 	freebsd)
 		(. /etc/rc.conf && echo "$hostname")
 		;;
+	netbsd)
+		if grep -q '^hostname=' /etc/rc.conf
+		then
+			(. /etc/rc.conf && echo "$hostname")
+		elif [ -f /etc/myname ]
+		then
+			# Fall back to /etc/myname file
+			cat /etc/myname
+		fi
+		;;
 	openbsd)
 		cat /etc/myname
 		;;
diff --git a/cdist/conf/type/__hostname/manifest b/cdist/conf/type/__hostname/manifest
index fe067718..b0948d24 100755
--- a/cdist/conf/type/__hostname/manifest
+++ b/cdist/conf/type/__hostname/manifest
@@ -60,6 +60,15 @@ case "$os" in
             --key 'hostname' \
             --value "$name_should"
     ;;
+    netbsd)
+        __key_value rcconf-hostname \
+            --file /etc/rc.conf \
+            --delimiter '=' \
+            --key 'hostname' \
+            --value "\"$name_should\""
+        # To avoid confusion, ensure that the hostname is only stored once
+        __file /etc/myname --state absent
+    ;;
     openbsd)
         echo "$name_should" | __file /etc/myname --source -
     ;;