We can use resolvconf to achieve what you all are trying to get.
Edit file - /etc/resolvconf/resolv.conf.d/base and put same entries as you would put in resolv.conf
Example:
nameserver 192.168.1.XXX
And then tell resolvconf to regenerate resolv.conf using command:
sudo resolvconf -u
I have been using same thing for my Ubuntu 14.04 templates to retain name server configuration even after guest customization.