bug with "hostname -i" [closed] - linux

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question does not appear to be about a specific programming problem, a software algorithm, or software tools primarily used by programmers. If you believe the question would be on-topic on another Stack Exchange site, you can leave a comment to explain where the question may be able to be answered.
Closed 2 years ago.
Improve this question
when i type :
hostname -i
my return is returning something really strange (for security it is not the real ip)
2001:db8:1f89::%et0 2001:db8:1f89::%eth1 2001:db8:1f89::%eth2 192.168.1.1 192.168.1.2
i have the same configuration on many other machine
and i dont fint why its is not returning the right thing, it should be only the ip set in the /etc/hosts file.
192.168.1.1
i tried :
hostnamectl
changing the /etc/hosts file
checked the /etc/host.conf
nmcli hostname
/etc/sysconfig/network
/etc/hostname
reboot
nothing point to this
regards,

Using the -i option display the network addresses of the host name, including the loopback interface and IPv6 link-local addresses.
Using the -I option display all network addresses of the host excluding loopback interface and IPv6 link-local addresses.
Sometime reading the man could be enough. Just type man hostname :)

Related

How to make "hostname -i" command to return ip address of a particular network interface device [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question does not appear to be about a specific programming problem, a software algorithm, or software tools primarily used by programmers. If you believe the question would be on-topic on another Stack Exchange site, you can leave a comment to explain where the question may be able to be answered.
Closed 2 years ago.
Improve this question
In some Linux hosts it returns IP of the interface eth0 and in some it returns IP assigned to NIC eth1 device, and in some machines it returns all the IP assigned to all the network interfaces.
$ hostname -i
*192.168.0.58 192.168.0.59 192.168.0.60*
How this is happening and how to configure this hostname command to return an IP of a particular network interface?
There seems to be no option in hostname to return the IP of a particular network interface.
Try this:
ifconfig eth0 | grep -Po 'inet \K(\S+)'

Global connection via netcat [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question does not appear to be about a specific programming problem, a software algorithm, or software tools primarily used by programmers. If you believe the question would be on-topic on another Stack Exchange site, you can leave a comment to explain where the question may be able to be answered.
Closed 2 years ago.
Improve this question
I would like to make very easy connection between two devices:
Device One is in WiFi1 and Device Two in WiFi2;
The Device One has local address 192.168.4.65;
The WiFi1 has IP address 12.34.56.78
(only example)
I want to run "nc -l <some parameters>" on my first device, and "nc <address>" on the second, so they connect;
I know, what to do if I want to connect two devices in a local area network;
But for global I have no Idea, what <some parameters> and <address> should be; can someone please help?
Thanks to #that-other-guy and #Barmar!!
You can do it by managing your router settings; If you configurate port forwarding, it will move you to the device you want to;
targeting 12.34.56.78:1234 to 192.168.4.65:1234. Then nc -l 1234 will be reachable with nc 12.34.56.78 1234

Permanently configure static IP Address of Bitnami Standalone Linux version [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
Closed 4 years ago.
This question does not appear to be about a specific programming problem, a software algorithm, or software tools primarily used by programmers. If you believe the question would be on-topic on another Stack Exchange site, you can leave a comment to explain where the question may be able to be answered.
This question does not appear to be about a specific programming problem, a software algorithm, or software tools primarily used by programmers. If you believe the question would be on-topic on another Stack Exchange site, you can leave a comment to explain where the question may be able to be answered.
Improve this question
How to permanently configure static IP Address of Bitnami Backendless Standalone Linux version?
The Bitnami VM comes configured to use DHCP.
The Bitnami FAQ says you can change the IP address using the command below:
An alternative approach is to configure the network manually and assign a static IP address to the virtual machine. For example, if your local network uses IP addresses of the form 192.168.1.X and you know that the IP address 192.168.1.234 is unassigned, manually assign this to the virtual machine by executing the command below at the virtual machine console:
sudo ifconfig eth0 192.168.1.234 netmask 255.255.255.0 up
Unfortunately, the IP Address is only assigned until the server is rebooted. After rebooting the VM, the IP address is dynamically allocated using DHCP.
ifconfig changes the IP Address only during the system runtime.
Depending on your Linux distribution, you've got to change the network setting by editing the related files.
Debian/Ubuntu
$ sudo vi /etc/network/interfaces
Fedora/Centos
$ sudo vi /etc/sysconfig/network-scripts/ifcfg-eth0

ifconfig never shows current IP address? [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question does not appear to be about a specific programming problem, a software algorithm, or software tools primarily used by programmers. If you believe the question would be on-topic on another Stack Exchange site, you can leave a comment to explain where the question may be able to be answered.
Closed 8 years ago.
Improve this question
I wish to know my current IP address (as the world sees it) via linux command line. I used ifconfig but it doesn't display the same ip address as is displayed on the website ip-details.com.
is there a way to get the current IP address from command line in linux?
thanks in advance
To find your external IP use the following command
$ dig myip.opendns.com #resolver1.opendns.com +short
This would give your IP as seen by a website
dig command is a DNS lookup utility.
DIG (domain information groper) is a flexible tool for interrogating DNS name servers.
It performs DNS lookups and displays the answers that are returned from the name server(s) that were queried
Are you using a VM (or) you are trying ifconfig from machine directly connected to internet ?
If you are trying from a VM it will not show. You have to try at host machine

DNS lookup using host IP not working [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question does not appear to be about a specific programming problem, a software algorithm, or software tools primarily used by programmers. If you believe the question would be on-topic on another Stack Exchange site, you can leave a comment to explain where the question may be able to be answered.
Closed 8 years ago.
Improve this question
I have set up a master DNS server using isc-bind. My problem is that when I try to look up hostnames from the same computer, it works when using localhost but not when I use the IP of the host.
This gives the correct answers:-
dig #localhost www.google.com
But this says "connection timed out; no servers could be reached"
dig #192.168.0.1 www.google.com
Here's my resolv.conf
nameserver 127.0.0.1
And when I run ping to 192.168.0.1, I get replies. What am I doing wrong here ??
Your instance of BIND is probably only listening on the loopback interface (127.0.0.1) and won't answer when addressed by an IP address that's associated with a real physical interface (your 192.168.0.1)
Look in your named.conf file for the listen-on directive. You may also need to change the allow-query ACL.

Resources