Take the 2-minute tour ×
Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

I bought a VPS server yesterday. Server companies support is not avaible for now. I am going to set dns adress. So i know 1 ip number they gave to me, how can i learn how many ip's i have and what are they? Is there command for ubuntu for that? Or any other way?

share|improve this question

migrated from stackoverflow.com Feb 21 '10 at 3:39

This question came from our site for professional and enthusiast programmers.

3 Answers 3

/sbin/ifconfig -a

Will result in something like

eth0      Link encap:Ethernet  HWaddr 00:1C:C0:78:D2:74  
          inet addr:aaa.bbb.ccc.dddd  Bcast:xxx.yyy.zzz.nnn  Mask:
          RX packets:423575721 errors:0 dropped:0 overruns:0 frame:0
          TX packets:126628915 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000 
          RX bytes:3433267581 (3.1 GiB)  TX bytes:4221095056 (3.9 GiB)
          Interrupt:17 Base address:0x6000 

lo        Link encap:Local Loopback  
          inet addr:  Mask:
          UP LOOPBACK RUNNING  MTU:16436  Metric:1
          RX packets:9838921 errors:0 dropped:0 overruns:0 frame:0
          TX packets:9838921 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0 
          RX bytes:4205604044 (3.9 GiB)  TX bytes:4205604044 (3.9 GiB)

Any IP address not assigned to lo is a public IP address (confirm that by trying to ping it from another machine)

share|improve this answer

ip addr as root is the way to go.

share|improve this answer
inet xx.xxx.39.203/24 brd xx.xxx.39.255 scope global eth0 i am getting this result, so it means what ? –  Anonymous Feb 20 '10 at 11:56

/sbin/ip addr as non-root ;-)

[kaman@host-10 ~]$ /sbin/ip a|grep -oP "inet (\d+\.){3}\d+"
share|improve this answer
This may or may not work, depending on the actual permissions of /sbin and /sbin/ip. I wouldn't count on it. –  joschi Apr 3 '10 at 6:14

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.