mattes / vagrant-dnsmasq

A Dnsmasq Vagrant plugin that manages the dnsmasq.conf file and /etc/resolver directory on your host system.
Other
100 stars 10 forks source link

Not all hostname commands support -I #8

Open rchady opened 10 years ago

rchady commented 10 years ago

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.

mattes commented 10 years ago

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