From 345850eb6cdcf5ca608ed0b3508a78da6bd908ef Mon Sep 17 00:00:00 2001 From: Fraser Tweedale Date: Mon, 11 Jun 2018 10:40:03 +1000 Subject: [PATCH] Vagrantfile: set DNS configuration in network-scripts The Vagrantfile puts the server's address in /etc/resolv.conf but this configuration will not survive a reboot or network restart. Add configuration to /etc/sysconfig/network-scripts/ to ensure the correct resolver is always used. --- Vagrantfile | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/Vagrantfile b/Vagrantfile index c4e6a925c..c3157ca6f 100644 --- a/Vagrantfile +++ b/Vagrantfile @@ -33,6 +33,10 @@ Vagrant.configure(2) do |config| replica.vm.network "private_network", ip: "192.168.33.11" replica.vm.hostname = "replica.ipademo.local" + replica.vm.provision "shell", + inline: 'echo "PEERDNS=no" >> /etc/sysconfig/network-scripts/ifcfg-eth0' + replica.vm.provision "shell", + inline: 'echo "DNS1=192.168.33.10" >> /etc/sysconfig/network-scripts/ifcfg-eth1' replica.vm.provision "shell", inline: 'echo "nameserver 192.168.33.10" > /etc/resolv.conf' end @@ -41,6 +45,10 @@ Vagrant.configure(2) do |config| client.vm.network "private_network", ip: "192.168.33.20" client.vm.hostname = "client.ipademo.local" + client.vm.provision "shell", + inline: 'echo "PEERDNS=no" >> /etc/sysconfig/network-scripts/ifcfg-eth0' + client.vm.provision "shell", + inline: 'echo "DNS1=192.168.33.10" >> /etc/sysconfig/network-scripts/ifcfg-eth1' client.vm.provision "shell", inline: 'echo "nameserver 192.168.33.10" > /etc/resolv.conf' client.vm.provision "shell",