Solved

Linux and IP addresses

Posted on 2014-11-18
2
113 Views
Last Modified: 2014-11-20
I have a hostname I want to examine

for instance:  xxx.xxx.com

Open in new window


So if I ping xxx.xxx.com I can get its external address

ex: 9.9.9.9

Open in new window


What utility do I use to get its internal address

Ex:  10.10.10.10

Open in new window

0
Comment
Question by:Anthony Lucia
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 12

Expert Comment

by:Kent W
ID: 40450550
Unless it's on your equipment, you can't.
You will need to provide a little more explanation.  Is this hostname on your network, or on some equipment you have access to, or somewhere else?
0
 
LVL 19

Accepted Solution

by:
jools earned 500 total points
ID: 40452004
Have you tried the other tools? there are a few;
eg
host, nslookup, dig

Using host;
# host www.experts-exchange.com
www.experts-exchange.com is an alias for experts-exchange-437318971.us-east-1.elb.amazonaws.com.
experts-exchange-437318971.us-east-1.elb.amazonaws.com has address 54.209.131.74
experts-exchange-437318971.us-east-1.elb.amazonaws.com has address 54.210.10.253

# host 54.209.131.74
74.131.209.54.in-addr.arpa domain name pointer ec2-54-209-131-74.compute-1.amazonaws.com.

Open in new window


Or Dig

# dig experts-exchange.com

; <<>> DiG 9.8.2rc1-RedHat-9.8.2-0.23.rc1.el6_5.1 <<>> experts-exchange.com
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 35580
;; flags: qr rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 0, ADDITIONAL: 0

;; QUESTION SECTION:
;experts-exchange.com.          IN      A

;; ANSWER SECTION:
experts-exchange.com.   86400   IN      A       54.86.90.123

;; Query time: 154 msec
;; SERVER: 194.168.4.100#53(194.168.4.100)
;; WHEN: Wed Nov 19 11:01:15 2014
;; MSG SIZE  rcvd: 54

# dig -x 54.86.90.123

; <<>> DiG 9.8.2rc1-RedHat-9.8.2-0.23.rc1.el6_5.1 <<>> -x 54.86.90.123
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 2044
;; flags: qr rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 0, ADDITIONAL: 0

;; QUESTION SECTION:
;123.90.86.54.in-addr.arpa.     IN      PTR

;; ANSWER SECTION:
123.90.86.54.in-addr.arpa. 300  IN      PTR     ec2-54-86-90-123.compute-1.amazonaws.com.

;; Query time: 22 msec
;; SERVER: 194.168.4.100#53(194.168.4.100)
;; WHEN: Wed Nov 19 11:01:22 2014
;; MSG SIZE  rcvd: 97

Open in new window


Or nslookup;

# nslookup www.experts-exchange.com
Server:         194.168.4.100
Address:        194.168.4.100#53

Non-authoritative answer:
www.experts-exchange.com        canonical name = experts-exchange-437318971.us-east-1.elb.amazonaws.com.
Name:   experts-exchange-437318971.us-east-1.elb.amazonaws.com
Address: 54.210.10.253
Name:   experts-exchange-437318971.us-east-1.elb.amazonaws.com
Address: 54.209.131.74

Open in new window


It sort of depends on if you have DNS entries or if the lookup is using the local hosts file.
0

Featured Post

Microsoft Certification Exam 74-409

Veeam® is happy to provide the Microsoft community with a study guide prepared by MVP and MCT, Orin Thomas. This guide will take you through each of the exam objectives, helping you to prepare for and pass the examination.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Linux Mailserver setup & redundancy 2 78
awk file 6 99
Internal CA server 6 92
Can't "Unset" Proxy in Apache headers for PCI compliance... 4 38
If you have a server on collocation with the super-fast CPU, that doesn't mean that you get it running at full power. Here is a preamble. When doing inventory of Linux servers, that I'm administering, I've found that some of them are running on l…
Using 'screen' for session sharing, The Simple Edition Step 1: user starts session with command: screen Step 2: other user (logged in with same user account) connects with command: screen -x Done. Both users are connected to the same CLI sessio…
Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.
How to Install VMware Tools in Red Hat Enterprise Linux 6.4 (RHEL 6.4) Step-by-Step Tutorial

749 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question