__/ [ 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
It seems to work in both directions:
roy@BAINE:~> getent hosts www.ukfsn.org
roy@BAINE:~> getent hosts 18.104.22.168