ros2 topic list is empty or nodes cannot see each other: ROS_DOMAIN_ID

ROS 2 nodes only see each other when they use the same ROS_DOMAIN_ID and can reach each other on the network.

What the message means

Discovery is automatic inside a domain. Different domain numbers keep nodes apart, and a firewall can block the discovery traffic between machines.

Fix it in this order

  1. Print echo $ROS_DOMAIN_ID in both terminals and make them the same.
  2. Check that both machines are on the same network and can reach each other.
  3. Allow the discovery traffic through the firewall, or test with the firewall off on a safe network.
  4. Make sure both sides use the same ROS 2 distribution and middleware.
  5. Run the node and ros2 topic list in terminals that both sourced the setup file.

If you see this, do this

You seeDo this
List empty on a second machineDomain ID, network or firewall.
Works on one machine onlyCheck discovery between machines.

ros2 command not found, Gazebo and ROS 2.

Last reviewed: November 2026. These are the usual causes and the order that finds them fastest. Test on your own board; clones and cables differ.