diff --git a/plugins/guests/debian/cap/change_host_name.rb b/plugins/guests/debian/cap/change_host_name.rb index 6ce256d7e..fe01aed4f 100644 --- a/plugins/guests/debian/cap/change_host_name.rb +++ b/plugins/guests/debian/cap/change_host_name.rb @@ -9,6 +9,7 @@ module VagrantPlugins comm.sudo("sed -i 's/.*$/#{name.split('.')[0]}/' /etc/hostname") comm.sudo("hostname -F /etc/hostname") comm.sudo("hostname --fqdn > /etc/mailname") + comm.sudo("ifdown -a; ifup -a") end end end diff --git a/plugins/guests/ubuntu/cap/change_host_name.rb b/plugins/guests/ubuntu/cap/change_host_name.rb index db052e40f..3e84bc787 100644 --- a/plugins/guests/ubuntu/cap/change_host_name.rb +++ b/plugins/guests/ubuntu/cap/change_host_name.rb @@ -14,6 +14,7 @@ module VagrantPlugins comm.sudo("service hostname start") end comm.sudo("hostname --fqdn > /etc/mailname") + comm.sudo("ifdown -a; ifup -a") end end end