title: Kafka Error connecting to node ubuntukafka:9092 (id: 0 rack: null) (org.apache.kafka.clients.NetworkClient) java.net.UnknownHostException:
body: <p>I have two servers on VirtualBox guests each ubuntu.  I can SSH from my main machine to both, and between the two so they all have the natnetwork.</p>
  
  <p>I ran on one server kafka as described here:</p>
  
  <p><a href="https://kafka.apache.org/quickstart" rel="noreferrer">https://kafka.apache.org/quickstart</a></p>
  
  <p>So I brought up singlenode zookeper
  Kafka then started.  I added the test topic.
  (All on MachineA . 10.75.1.247)</p>
  
  <p>I am trying to list the topics on that node from another machine:</p>
  
  <pre><code>bin/kafka-topics.sh --list --bootstrap-server 10.75.1.247:9092
  </code></pre>
  
  <p>from MachineB (10.75.1.2)</p>
  
  <p>doing that, causes the error over and over:</p>
  
  <pre><code>[2019-09-16 23:57:07,864] WARN [AdminClient clientId=adminclient-1] Error connecting to node ubuntukafka:9092 (id: 0 rack: null) (org.apache.kafka.clients.NetworkClient)
  java.net.UnknownHostException: ubuntukafka
      at java.base/java.net.InetAddress$CachedAddresses.get(InetAddress.java:797)
      at java.base/java.net.InetAddress.getAllByName0(InetAddress.java:1505)
      at java.base/java.net.InetAddress.getAllByName(InetAddress.java:1364)
      at java.base/java.net.InetAddress.getAllByName(InetAddress.java:1298)
      at org.apache.kafka.clients.ClientUtils.resolve(ClientUtils.java:104)
      at org.apache.kafka.clients.ClusterConnectionStates$NodeConnectionState.currentAddress(ClusterConnectionStates.java:403)
      at org.apache.kafka.clients.ClusterConnectionStates$NodeConnectionState.access$200(ClusterConnectionStates.java:363)
      at org.apache.kafka.clients.ClusterConnectionStates.currentAddress(ClusterConnectionStates.java:151)
      at org.apache.kafka.clients.NetworkClient.initiateConnect(NetworkClient.java:943)
      at org.apache.kafka.clients.NetworkClient.ready(NetworkClient.java:288)
      at org.apache.kafka.clients.admin.KafkaAdminClient$AdminClientRunnable.sendEligibleCalls(KafkaAdminClient.java:925)
      at org.apache.kafka.clients.admin.KafkaAdminClient$AdminClientRunnable.run(KafkaAdminClient.java:1140)
      at java.base/java.lang.Thread.run(Thread.java:834)
  </code></pre>
  
  <p>it does resolve the name
  (says ubuntukafka instead of ubuntukafkanode) but fails.</p>
  
  <p>What am I missing?  Am I using kafka wrong?  I thought I could have a nice kafka server where all my other servers with data can produce information too.  Then many other consumers can read the information from? </p>
  
  <p>Ultimately what I wanted to test was if I could send messages to my kafka server:</p>
  
  <pre><code>bin/kafka-console-producer.sh --broker-list 10.75.1.247:9092 --topic test
  </code></pre>
  
  <p>And even then use python later to produce messages to the server.</p>
  
  <pre><code>from kafka import KafkaProducer
  
  producer = KafkaProducer(bootstrap_servers='10.75.1.247:9092')
  for _ in range(100):
      try:
          producer.send('test', b'some_message_bytes')
      except:
          print('doh')
  </code></pre>