java.net.UnknownHostException

If you like a tip written by other Samebug users, mark is as helpful! Marks help our algorithm provide you better solutions and also help other users.
tip

When kafka creates new consumers, it simply concatenate the name of your VM to generate the consumer id. So, your VM resolves localhost as the name of your VM, not whatever you had set. To solve, add kafka(or the name of VM) plus address to /etc/hosts

You have a different solution? A short tip here would help you and many other users who saw this issue last week.

  • localhost cant connect to 127.0.0.1
    via Ask Ubuntu by hilmanshini
    ,
  • Trouble installing Pyspark
    via by Unknown author,
  • Could not find or load main class
    via by İsmail Ali Gençay,
  • UnknownHostException kafka
    via Stack Overflow by noplay
    ,
    • java.net.UnknownHostException: local.localdomain: diginiqlinux.localdomain at java.net.InetAddress.getLocalHost(InetAddress.java:1466)

    Users with the same issue

    raj76raj76
    2 times, last one,
    nasimknasimk
    2 times, last one,
    Unknown visitor
    Unknown visitor1 times, last one,
    Unknown visitor
    Unknown visitor1 times, last one,
    Unknown visitor
    Unknown visitor1 times, last one,
    9 more bugmates