diff --git a/unbound/templates/unbound.conf.j2 b/unbound/templates/unbound.conf.j2
index 3c40228aa2173cc350b8f3149454346884697c5f..ff7cb81d34744f92410e97d8869e9494ddf5a770 100644
--- a/unbound/templates/unbound.conf.j2
+++ b/unbound/templates/unbound.conf.j2
@@ -6,8 +6,10 @@ server:
 	access-control: {{i}} allow
 	{% endfor %}
 
+{% if unbound_upstream_hosts is defined and unbound_upstream_hosts %}
 forward-zone:
 	name: "."
 	{% for i in unbound_upstream_hosts %}
 	forward-addr: {{i}}
 	{% endfor %}
+{% endif %}