T o n g wrote:
> Bob Proulx wrote:
> >> . . . how to get *only* the IP address of my current
> >> Intranet address 192.168...?
>
> Thanks for your answer Bob,
>
> > Or if you don't like loopback addresses showing up in the list:
> >
> > $ ip addr show | awk '/ inet / && !/127\./{print$2}'
>
T o n g wrote:
> Now a related question, how to get *only* the IP address of my
> current Intranet address 192.168...?
>
> Is there easier answers than analysing results from the following?
>
> ifconfig eth0
> ip addr
> ip -f inet addr
Please remember that hosts have devices and devices have
On Tue, Nov 15, 2011 at 5:02 AM, Chris Davies wrote:
>> On Mon, Nov 14, 2011 at 11:44 AM, T o n g wrote:
> Tom H wrote:
>>>
>>> I know how to get an IP address *info* using dig, but has anyone looked
>>> into how to get *only* the IP address? so that I can use, eg.
>>>
>>> the_ip=`get_ip host`
Chris Davies wrote:
> Fails for CNAME chains, sorry!
>
> $ dig +short www.bbc.co.uk
> www.bbc.net.uk.
> 212.58.246.94
>
> (You could try dig +short ... | grep -v '\.$', but I've not tested that
> exhaustively.)
You might use the bind9-host 'host' command.
$ host www.bbc.co.uk
www.bbc.co.uk
> On Mon, Nov 14, 2011 at 11:44 AM, T o n g wrote:
>> I know how to get an IP address *info* using dig, but has anyone looked
>> into how to get *only* the IP address? so that I can use, eg.
>>
>> the_ip=`get_ip host`
Tom H wrote:
> dig +short ...
Fails for CNAME chains, sorry!
$ dig +short w
On Mon, Nov 14, 2011 at 3:22 PM, Bob Proulx wrote:
>
> The 'getent' utility is part of GNU glibc and is present on any GNU
> glibc based system but not present on others. It won't work on HP-UX
> for example.
"getent" exists in Solaris.
--
To UNSUBSCRIBE, email to debian-user-requ...@lists.deb
Bob Proulx wrote:
>
> The 'getent' utility is part of GNU glibc and is present on any GNU
> glibc based system but not present on others. It won't work on HP-UX
> for example. Certainly if you only care about GNU/Linux machines then
> you should be safe using it. A good suggestion.
That's good
Clive Standbridge wrote:
> Kind people have already suggested dig and host,
'dig' and 'host' are the portable way to look things up since those
either already exist or can exist on any Unix-like system.
> but may I make another suggestion:
>
>getent hosts $hostname | awk '{print $1}'
>
> It
> Hi,
>
> I know how to get an IP address *info* using dig, but has anyone looked
> into how to get *only* the IP address? so that I can use, eg.
>
> the_ip=`get_ip host`
Hi Tong,
Kind people have already suggested dig and host, but may I make
another suggestion:
getent hosts $hostname |
On Mon, 14 Nov 2011 16:44:48 +, T o n g wrote:
> I know how to get an IP address *info* using dig, but has anyone looked
> into how to get *only* the IP address? so that I can use, eg.
>
> the_ip=`get_ip host`
Not sure if this will be bulletproof but...
sm01@stt008:~$ host -t a google.com|
On Mon, Nov 14, 2011 at 11:44 AM, T o n g wrote:
>
> I know how to get an IP address *info* using dig, but has anyone looked
> into how to get *only* the IP address? so that I can use, eg.
>
> the_ip=`get_ip host`
dig +short ...
--
To UNSUBSCRIBE, email to debian-user-requ...@lists.debian.org
11 matches
Mail list logo