diff --git a/lib/vagrant/systems/debian.rb b/lib/vagrant/systems/debian.rb index 674ec1ff8..1914a28f6 100644 --- a/lib/vagrant/systems/debian.rb +++ b/lib/vagrant/systems/debian.rb @@ -26,6 +26,7 @@ module Vagrant vm.ssh.execute do |ssh| if !ssh.test?("sudo hostname | grep '#{name}'") ssh.exec!("sudo sed -i 's/.*$/#{name}/' /etc/hostname") + ssh.exec!("sudo sed -i 's@^\\(127[.]0[.]1[.]1[[:space:]]\\+\\)@\\1#{name} #{name.split('.')[0]} @' /etc/hosts") ssh.exec!("sudo service hostname start") end end