How to set host name in Xavier?

We are struggling with ROS network settings.

Host PC (Ubuntu 18.04 laptop) & Jetson xavier (Jetpack 4.2.3)(Ubuntu 18.04)

Both devices can be connected through ping or ssh , but Jetson Xavier or PC cannot read each ROS server on the host PC. (PC <-> Xavier ROS connection doen’t work)
[error code]
WARNING:ROS_MASTER_URI [http://:11311] host is not set to this machine

Host PC: rospc@192.16x.xx.xx

I also tried to ADD host name in Xavier.
But Xavier cannot connect(ping) to PC using hostname. PC can connect to Xavier using hostname.

Do you have any ideas?
Thank you for your help

Usually a router is what provides DNS host names if two or more machines must understand that name. A Linux host can alias an IP address to a name using “/etc/hosts”. For example, if you do this from the Jetson’s “/etc/hosts”, then the Jetson will know a correct IP address: pc

As a result, if is a PC reachable from the Jetson, and if there are no firewall or other issues, then these would work equally well:

ping pc

In a case where the router does not provide a name, then you would have to do this on each host (even Windows has “C:Windows\System32\drivers\etc\hosts” (or a variation on “Windows”).

This won’t cause a missing network configuration to work, all it does is give a name alias. If ping to the dotted-decimal address does not work, then there is more to set up.

NOTE: Your router might have the ability to assign a name which works for anything on the router, but not outside of your own local network.


Thank you for your reply.
In Jetson, I add an IP address and PCname to a name using “/etc/hosts”.
ex) pc
In my case, Jetson doesn’t connect other device using PCname. But ping IP address was work.
Thank you for your help.

Can I verify that the Jetson has a line in “/etc/hosts”: pc

Also, that from the Jetson you can successfully “ping”, but fail to “ping pc”?

If this is the case, then what do you see from “traceroute” and “traceroute pc”?