Is there a unix command to find ALL hostnames for an ip address?


 
Thread Tools Search this Thread
Top Forums UNIX for Dummies Questions & Answers Is there a unix command to find ALL hostnames for an ip address?
# 1  
Old 02-23-2010
Is there a unix command to find ALL hostnames for an ip address?

I am trying to determine if there are several url/host names for an IP address. Is there a UNIX command to find ALL host names for an IP address?

Thank you in advance.
# 2  
Old 02-23-2010
You can use dig


dig -x ipaddr

Check the man page for more details
# 3  
Old 02-23-2010
Generally the hostname command will let you to know about your hostname for the specified IP address.
If there is some alias you have to use the --alias option. The hostname entries will be available in /etc/hostname file
So using cat /etc/hostname you can know the hostnames of your IP.

Last edited by thillai_selvan; 03-15-2010 at 01:24 AM..
# 4  
Old 02-23-2010
Thank you for responding. I tried "dig -x <ipaddress>", but it did not return the host names and returned the below. There are websites like dm.tj12.net that can perform Reverse IP and show ALL host names, but I wanted to know what command they were running. If you could share this information, that would be great.

; <<>> DiG 9.4.3-P1 <<>> -x 208.76.86.26
;; global options: printcmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 29540
;; flags: qr rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 0, ADDITIONAL: 0

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

;; ANSWER SECTION:
26.86.76.208.in-addr.arpa. 86400 IN PTR memphis.tchmachines.com.

;; Query time: 428 msec
;; SERVER: 192.168.33.1#53(192.168.33.1)
;; WHEN: Tue Feb 23 17:58:38 2010
;; MSG SIZE rcvd: 80
 
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. UNIX for Beginners Questions & Answers

Find heartbeat ip address with cllsif command

hi~~ my Os is 6.1 i want to find heartbeat ip address from below result. i think, is it en7 onto both nodes? /usr/es/sbin/cluster/utilities/cllsif Adapter Type Network Net Type Attribute Node IP Address Hardware Address Interface Name Global Name ... (2 Replies)
Discussion started by: tomato00
2 Replies

2. Shell Programming and Scripting

Ip address for multiple hostnames

i have a file which has 100 servers,i want a script which can output me ip address and hostname for that server. Thanks in advance!! input file abc.com output file should be abc.com 192.168.1..1 (1 Reply)
Discussion started by: Moon1234
1 Replies

3. Shell Programming and Scripting

How to capture hostnames or ip address in the log files generated?

Team, I have prepared a script which I run from my remote machine(Jump-box)server Below is the script FILEDATE=`date +%F` LOGFILE=/home/abc/scripts/xyz.$FILEDATE.log find /home/abc/scripts/xyz.*.log -type f -mtime -3 -delete touch $LOGFILE exec 1>$LOGFILE 2>&1 #healthcheck batch runs... (1 Reply)
Discussion started by: whizkidash
1 Replies

4. UNIX for Dummies Questions & Answers

Finding e-mail address using "find" command

any useful command to find and e-mail address hardcoded into a cfg file on an specific server? I already tried with:: find . -type f | xargs grep -l "nobody@foundstone.com" Thanks!! (1 Reply)
Discussion started by: JLo5621
1 Replies

5. Programming

How do I find the MAC address in C on different UNIX platforms?

I need to find the MAC address of the ethernet cards on the host machine from the C language. I have found a way to do this on Linux using socket(), ioctl() and the ifreq structure. But this does not seem to work on AIX, HP/UX and probably the others I need (Solaris, SCO, Alpha etc). Is there a... (7 Replies)
Discussion started by: Pug
7 Replies

6. Cybersecurity

Help Required: Command to find IP address and command executed of a user

Hi, I am trying to write a script which would figure out who has run which command and their IP. As i dont have any clue as to which commands would do this job, i request some gurus to help me on this. Thanks Vishwas (2 Replies)
Discussion started by: loggedout
2 Replies

7. UNIX for Advanced & Expert Users

Find IP Address of a Printer Q in Hp-Unix

Could anyone help me to identify the IP address of a printer queue with its printer queue name information . (1 Reply)
Discussion started by: lenin1985
1 Replies

8. Shell Programming and Scripting

Little bit weired : Find files in UNIX w/o using find or where command

Yes , I have to find a file in unix without using any find or where commands.Any pointers for the same would be very helpful as i am beginner in shell scritping and need a solution for the same. Thanks in advance. Regards Jatin Jain (10 Replies)
Discussion started by: jatin.jain
10 Replies

9. Shell Programming and Scripting

how to find a file in UNIX without find command?

given a start directory,a filename,how to find it? (3 Replies)
Discussion started by: bluo
3 Replies

10. IP Networking

Mac address - what is line command to find and active new card

How do you find mac address and active new card. (1 Reply)
Discussion started by: wmetz
1 Replies
Login or Register to Ask a Question