Note that there are some explanatory texts on larger screens.

plurals
  1. PORuby DNSSD Bonjour IP address discovery
    primarykey
    data
    text
    <p>BACKGROUND</p> <p>I am trying to use Ruby DNSSD to discover the IP address of a few devices. </p> <p>My code will correctly discover the NAME of the devices. I tried to access the devices using the NAME.local. I have tried this method: <a href="https://github.com/jmitchener/ruby-dnssd-test/blob/master/main.rb" rel="nofollow">https://github.com/jmitchener/ruby-dnssd-test/blob/master/main.rb</a></p> <ul> <li>How do I find their IP address? Or</li> <li>Access those devices using the hostname? </li> </ul> <p>UPDATE</p> <p>I proved to my self that my theory that the Socket command is not searching past the /etc/hosts file</p> <p>I manually aded my three redeye units to the /etc/hosts file and was able to resolve the IP address. </p> <p>/etc/hosts</p> <pre><code>192.168.69.77 RedEye_B0105-92646.local. 192.168.69.75 RedEye_E0103-85245.local. 192.168.69.76 RedEye_B0104-99552.local. </code></pre> <p>code</p> <pre><code> @@reIP = Hash.new DNSSD.browse '_tf_redeye._tcp' do |reply| puts reply.name addr = Socket.getaddrinfo(reply.name + ".local.", nil, Socket::AF_INET) @@reIP[reply.name] = addr puts @@reIP end </code></pre> <p>output</p> <pre><code>RedEye_B0105-92646 {"RedEye_B0105-92646"=&gt;[["AF_INET", 0, "192.168.69.77", "192.168.69.77", 2, 1, 6], ["AF_INET", 0, "192.168.69.77", "192.168.69.77", 2, 2, 17], ["AF_INET", 0, "192.168.69.77", "192.168.69.77", 2, 3, 0]]} RedEye_E0103-85245 {"RedEye_B0105-92646"=&gt;[["AF_INET", 0, "192.168.69.77", "192.168.69.77", 2, 1, 6], ["AF_INET", 0, "192.168.69.77", "192.168.69.77", 2, 2, 17], ["AF_INET", 0, "192.168.69.77", "192.168.69.77", 2, 3, 0]], "RedEye_E0103-85245"=&gt;[["AF_INET", 0, "192.168.69.76", "192.168.69.76", 2, 1, 6], ["AF_INET", 0, "192.168.69.76", "192.168.69.76", 2, 2, 17], ["AF_INET", 0, "192.168.69.76", "192.168.69.76", 2, 3, 0]]} RedEye_B0104-99552 {"RedEye_B0105-92646"=&gt;[["AF_INET", 0, "192.168.69.77", "192.168.69.77", 2, 1, 6], ["AF_INET", 0, "192.168.69.77", "192.168.69.77", 2, 2, 17], ["AF_INET", 0, "192.168.69.77", "192.168.69.77", 2, 3, 0]], "RedEye_E0103-85245"=&gt;[["AF_INET", 0, "192.168.69.76", "192.168.69.76", 2, 1, 6], ["AF_INET", 0, "192.168.69.76", "192.168.69.76", 2, 2, 17], ["AF_INET", 0, "192.168.69.76", "192.168.69.76", 2, 3, 0]], "RedEye_B0104-99552"=&gt;[["AF_INET", 0, "192.168.69.76", "192.168.69.76", 2, 1, 6], ["AF_INET", 0, "192.168.69.76", "192.168.69.76", 2, 2, 17], ["AF_INET", 0, "192.168.69.76", "192.168.69.76", 2, 3, 0]]} </code></pre> <p>The question now is why is the Socket command not searching past the /etc/hosts file for IP resolution<br> 1. AVAHI and/or DNSSD is not caching the address as they are reports by the DNSSD.browse, possible a configuration setting<br> 2. I do not have a mDNS server installed or configured properly<br> 3. Something else is conflicting, like DNSMASQ </p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload