Allow setting resolv.conf
diff --git a/README.rst b/README.rst
index 2e782e6..68390d7 100644
--- a/README.rst
+++ b/README.rst
@@ -378,6 +378,21 @@
- node2.domain.com
- service2.domain.com
+Setup resolv.conf, nameservers, domain and search domains
+
+.. code-block:: yaml
+
+ linux:
+ network:
+ resolv:
+ dns:
+ - 8.8.4.4
+ - 8.8.8.8
+ domain: my.example.com
+ search:
+ - my.example.com
+ - example.com
+
Linux storage pillars
---------------------
diff --git a/linux/files/resolv.conf b/linux/files/resolv.conf
new file mode 100644
index 0000000..bc67b0a
--- /dev/null
+++ b/linux/files/resolv.conf
@@ -0,0 +1,14 @@
+{%- from "linux/map.jinja" import network with context %}# Dynamic resolv.conf(5) file for glibc resolver(3) generated by salt-minion(1)
+# DO NOT EDIT THIS FILE BY HAND -- YOUR CHANGES WILL BE OVERWRITTEN
+{% if network.resolv.search -%}
+search {{ network.resolv.search|join(' ') }}
+{%- endif %}
+{% if network.resolv.domain -%}
+domain {{ network.resolv.domain }}
+{%- endif %}
+{%- for nameserver in network.resolv.dns %}
+nameserver {{ nameserver }}
+{%- endfor %}
+{%- if network.resolv.options %}
+options {{ options|sort|join(' ') }}
+{%- endif %}
diff --git a/linux/network/init.sls b/linux/network/init.sls
index 2238cdd..cc9008a 100644
--- a/linux/network/init.sls
+++ b/linux/network/init.sls
@@ -4,6 +4,9 @@
{%- if network.host|length > 0 %}
- linux.network.host
{%- endif %}
+{%- if network.resolv is defined %}
+- linux.network.resolv
+{%- endif %}
{%- if network.interface|length > 0 %}
- linux.network.interface
{%- endif %}
diff --git a/linux/network/resolv.sls b/linux/network/resolv.sls
new file mode 100644
index 0000000..5db4d6d
--- /dev/null
+++ b/linux/network/resolv.sls
@@ -0,0 +1,10 @@
+{%- from "linux/map.jinja" import network with context %}
+{%- if network.enabled %}
+
+/etc/resolv.conf:
+ file.managed:
+ - source: salt://linux/files/resolv.conf
+ - mode: 644
+ - template: jinja
+
+{%- endif %}