"hostname -i" returns only 127.0.0.1, but other Manjaro computer returns also LAN IP

Hello,
on one Manjaro Linux i “hostname -i” returns LAN IP, but on other only localhost IP 127.0.0.1
do you have idea how to make it report LAN IP without manually modifying any file?

The correct way of reporting a LAN IP is:

ip address

and according to the hostname's man page:

       -i, --ip-addresses
              addresses for the host name

So any address is fine for that tool to display, so:

is impossible to solve…

:sob:

I’ve marked this answer as the solution to your question as it is by far the best answer you’ll get.

However, if you disagree with my choice, please feel free to take any other answer as the solution to your question or even remove the solution altogether: You are in control! (If you disagree with my choice, just send me a personal message and explain why I shouldn’t have done this or :heart: or :+1: if you agree)

:innocent:
P.S. In the future, please don’t forget to come back and click the 3 dots below the answer to mark a solution like this below the answer that helped you most:
Solution
so that the next person that has the exact same problem you just had will benefit from your post as well as your question will now be in the “solved” status.

That depends on the hosts file.

When you are using dhcp addressing - the default - the hosts file will contain 127.0.0.1 for local host which is what you get.

When you define the computer name - usually you assign 127.0.1.1 to the hostname when the IP is dhcp assigned and the IP address if you assign a static IP.

This topic was automatically closed 15 days after the last reply. New replies are no longer allowed.