Hostname resolution fails using zeroconf
See original GitHub issueProblem
Using the zeroconf discovery, SyncThread on local host hostfoo
throws errors about being unable to resolve the hostname of a remote host hostbar
:
[INFO][rosout]: hostbar is now online
[INFO][rosout]: SyncThread[hostfoo] Requesting remote state from 'http://hostbar:11911/'
[ERROR][rosout]: SyncThread[hostfoo] ERROR: Traceback (most recent call last):
File "/opt/ros/kinetic/lib/python2.7/dist-packages/master_sync_fkie/sync_thread.py", line 264, in _request_remote_state
remote_state = remote_monitor.masterInfo()
File "/usr/lib/python2.7/xmlrpclib.py", line 1243, in __call__
return self.__send(self.__name, args)
File "/usr/lib/python2.7/xmlrpclib.py", line 1602, in __request
verbose=self.__verbose
File "/usr/lib/python2.7/xmlrpclib.py", line 1283, in request
return self.single_request(host, handler, request_body, verbose)
File "/usr/lib/python2.7/xmlrpclib.py", line 1311, in single_request
self.send_content(h, request_body)
File "/usr/lib/python2.7/xmlrpclib.py", line 1459, in send_content
connection.endheaders(request_body)
File "/usr/lib/python2.7/httplib.py", line 1053, in endheaders
self._send_output(message_body)
File "/usr/lib/python2.7/httplib.py", line 897, in _send_output
self.send(msg)
File "/usr/lib/python2.7/httplib.py", line 859, in send
self.connect()
File "/usr/lib/python2.7/httplib.py", line 836, in connect
self.timeout, self.source_address)
File "/usr/lib/python2.7/socket.py", line 557, in create_connection
for res in getaddrinfo(host, port, 0, SOCK_STREAM):
gaierror: [Errno -2] Name or service not known
Notes:
- There is no network-wide name resolution, I want to rely on mdns only.
- It’s an IPv6-only network
Debugging
My /etc/nsswitch.conf
(relevant line):
hosts: files mdns [NOTFOUND=return] dns
The parameters for the zeroconf node are default; the zeroconf nodes discover each other perfectly.
Manual hostname resolution fails with:
host hostbar
host hostbar.local
avahi-resolve -n hostbar
getent hosts hostbar
Manual hostname resolution works with:
avahi-resolve -n hostbar.local
getent hosts hostbar.local
I’m not sure, it might be a better idea to use hostbar.local
instead?
Issue Analytics
- State:
- Created 4 years ago
- Comments:7 (7 by maintainers)
Top Results From Across the Web
FS#18278 : [avahi] Zeroconf hostname resolution for .local fails
Description: When I use avahi-resolve-host-name laptop.local, it returns an IPv4 or IPv6 address, but when using e.g. ping laptop.local, I get 'Unknown host'....
Read more >How can I resolve .local addresses in Windows? - Super User
I've got some Linux servers on my home network that I access via "hostname.local", however ...
Read more >Name Resolution Problems with ".local" Domains | Support
Applications or system programs like ping have problems with the resolution of names in a DNS domain ending with .local.
Read more >can't connect using mDNS addressing when systemd ...
[chris@fmac ~]$ sudo systemctl start systemd-resolved.service [chris@fmac ~]$ ssh chris ssh: Could not resolve hostname flap.local: Name or ...
Read more >Cannot resolve .local addresses from within Home Assistant ...
local hostnames for devices on my network. If I try to use any of those .local hostnames from within the container, it fails....
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I added a
fqdn
parameter. You have to set this parameter totrue
.Regarding your post, I’m afraid that the ROS-topic communication will not work anyway. But you can try it out!
Well, it’s not that undocumented: http://www.ros.org/news/2012/06/ipv6-support-for-ros-nodes.html