Home Messages Index
[Date Prev][Date Next][Thread Prev][Thread Next]
Author IndexDate IndexThread Index

Re: How to get IP address of named host?

  • Subject: Re: How to get IP address of named host?
  • From: Roy Schestowitz <newsgroups@xxxxxxxxxxxxxxx>
  • Date: Sat, 25 Feb 2006 09:18:55 +0000
  • Newsgroups: uk.comp.os.linux
  • Organization: schestowitz.com / MCC / Manchester University
  • References: <di6uv1prns81l5n06ac497qn6gsihjgs6e@4ax.com> <Pine.LNX.4.44.0602241620520.1574-100000@yeoshua.ukpost.com> <ioeuv1tbllpdehdq92bl7tg06bqrc8nnkl@4ax.com>
  • Reply-to: newsgroups@xxxxxxxxxxxxxxx
  • User-agent: KNode/0.7.2
__/ [ Dave Farrance ] on Friday 24 February 2006 17:02 \__

> Jason Clifford <jason@xxxxxxxxxx> wrote:
> 
>>On Fri, 24 Feb 2006, Dave Farrance wrote:
>>> How do I do that sort of  IP lookup for a hostname in a shell script?
>>
>>In a bash shell script the simplest way is probably to use getent like so:
>>
>>getent hosts www.ukfsn.org
>>
>>This will return the IP and then the host name.
> 
> Thanks Jason. That's a good one.
> 
> Also thanks to Jim and Paul - and I'll have to remember that many of
> the C system calls are duplicated in perl.

Thanks for that too, Jason. Simple command, which is yet so powerful. So long
Web-based tools, which thus far I have used for DNS lookup and reverse DNS
lookup.

It seems to work in both directions:

roy@BAINE:~> getent hosts www.ukfsn.org
217.158.120.136 www.ukfsn.org
roy@BAINE:~> getent hosts 130.88.190.250
130.88.190.250  cg250a.halls.manchester.ac.uk

[Date Prev][Date Next][Thread Prev][Thread Next]
Author IndexDate IndexThread Index