vagrant-dnsmasq icon indicating copy to clipboard operation
vagrant-dnsmasq copied to clipboard

Not all hostname commands support -I

Open rchady opened this issue 11 years ago • 1 comments

By default this plugin uses 'hostname -I' to try to determine the IP address(es) of a guest system. Unfortunately, not all OS versions support -I. Wouldn't it be just as easy to look at the output of ifconfig and parse it out? Even nicer would be to have it look at ifconfig output and allow you to configure acceptable IP ranges. That way you could filter out localhost, etc.

rchady avatar Dec 30 '13 21:12 rchady

I agree. Right now a work-around would be possible with:

config.dnsmasq.ip = proc do |guest_machine| 
  guest_machine.communicate.sudo("command to obtain ip somehow") do |type, data| 
    # return something like '192.168.59.100' or ['192.168.59.100', '192.168.59.103']
  end
end

mattes avatar Mar 03 '14 22:03 mattes