ifconfig never shows current IP address? [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 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

Related

How can I find my IP address when inside a Server [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 1 year ago.
Improve this question
I have a Linux server is hosting in a host company. I don't know what is the public IP address of the server. I can only ssh to the server using their Cloud access. I'm wondering if there's any tools that I can use to tell what is the public IP address of the Server I'm inside.
This cyberciti.biz article Expline how to find your public IP address.
To show IP address of server use this command: ifconfig -a.
I found this website service that you can create a link URL then send a request to that URL to reveal your IP Address and header details which is cool.
https://www.requestheader.com/

Multiple IPv6 address based on SLAAC prefix on Linux [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 1 year ago.
Improve this question
I'd like to ask is there any way to make linux get more than one (or let we say 1000) IPv6 address base on SLAAC announced prefix?
I used to do ip a add IPV6_ADDR on boot when I have a static IPv6 prefix, but now my ISP gives a dynamic prefix instead of a fixed one, which makes the added addresses expire after they changed the prefix.
An alternative way I've thought is to make a script run when the prefix is changed to re-add IPs with new prefix, but I didn't find how to do it too :(
Thanks.
Solved: It cames out I can use macvlan to solve this problem.
~# ip link add link eth0 eth0.2 type macvlan
~# ip link set dev eth0.2 up

bug with "hostname -i" [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
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 :)

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

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