lookup ip address, subnet mask, gateway, and dns at same time


 
Thread Tools Search this Thread
Special Forums IP Networking lookup ip address, subnet mask, gateway, and dns at same time
# 1  
Old 02-13-2011
lookup ip address, subnet mask, gateway, and dns at same time

Is there a command that can lookup ip address, subnet mask, gateway, and dns all at the same. I know ifconfig can lookup ip address and subnet mask. I know route -n can lookup gateway. Not sure about a dns command. So I hope there is a way to lookup ip address, subnet mask, gateway, and dns all at the same.
# 2  
Old 06-13-2011
.

i think there is no command for this..

i have changed something again:

gedit ipconfig.sh

Code:
#! /bin/bash
ifconfig | awk '/inet/ {print "IP " $2}'
echo -e "\nGateway\t\t\tInterface"
route -n | awk '/UG/ {printf "%-21s %s\n",$2,$8}'

RESOLVEDOTCONF=/etc/resolv.conf
if [ -f $RESOLVEDOTCONF ]
then
echo -e "\nDNS Servers \n-----------"
grep "nameserver " $RESOLVEDOTCONF | awk '{print $2}'
fi
DHCPfile=/var/lib/dhcp3/dhclient.leases
if [ -f $DHCPfile ]
then
echo -e "\nDHCP Server"
awk '/dhcp-server-identifier/ {print $3}' $DHCPfile
fi


chmod +x ipconfig.sh
sh ipconfig.sh


it may help u..
# 3  
Old 06-13-2011
While the combination of ip address, netmask, gateway and DNS may seem logical, they are separate entities (well, DNS and gateway are separate from NIC config anyhow).

So... no. You can build a quick script to query the 3 pieces and output them all though.
Login or Register to Ask a Question

Previous Thread | Next Thread

9 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Get all ip address from subnet mask

I have this subnet file shown below. How can I calculate all ip addresses from that list 103.22.200.0/22 141.101.64.0/18 10.0.0.0/22I need to be able to read the subnet file and print all IPs in those subnet to an out put file (3 Replies)
Discussion started by: e_mikey_2000
3 Replies

2. Solaris

Changing the subnet mask on solaris 10

Hello, can anyone help me with the command to change the subnet mask on solaris 10? The mask is currently 255.255.255.255 I will like to change it to 255.255.2555.0. Thank you (5 Replies)
Discussion started by: cjashu
5 Replies

3. AIX

Changing subnet mask for a NIM Network.

I am new to this forum so please bare with me. I did search for this answer prior to posting but no luck. Running an AIX NIM Master at 5.3TL9SP4, with about 100 clients. The subnet of one of the networks defined in the NIM env has changed. When I go to Manage Networks, Change/Show... (0 Replies)
Discussion started by: juredd1
0 Replies

4. Solaris

how to change the subnet mask of interface

Hi all, could you please tell me how to Change the subnet mask of interface aded:1 from ffffffc0 to ffffff80 regards Krishna (7 Replies)
Discussion started by: murthy76
7 Replies

5. Solaris

Need help in changing the subnet mask

Hi, I have a task to edit the subnet mask in almost 100+ solaris servers.Few of the servers are configured with IPMP.There will be no change of IP address or default gateway.If its a single IP we can bring NIC down,change the subnet mask in /etc/netmasks,then bring the NIC back to normal.But... (3 Replies)
Discussion started by: rajip23
3 Replies

6. IP Networking

Static IP / Subnet mask and Gateway

Hi all, I installed Fedora 9 + squid at one of PC at work. Our company has windows 2003 servera acting as DHCP server. During installation, i set linux box up as Static IP (192.168.0.100) But once installation completed, The pc is assigned a different IP address instead of 192.168.0.100.... (3 Replies)
Discussion started by: c00kie88
3 Replies

7. IP Networking

changing the subnet mask permanently

I understand how to change the ip address permanently however, I need to also make a permanent change to the subnet mask. How would I accomplish this. (5 Replies)
Discussion started by: johnparksjr
5 Replies

8. UNIX for Dummies Questions & Answers

Modifying IP Address/Gateway/Subnet in SCO Unix

Hi, I'm new to unix and have absolutely no experience with it. I am trying to change the network setting on the only computer on our network with SCO Unix. We switched ISP's and now have a new set of IP's. I can't for the life of me figure out how to go in and change these settings, please help.... (12 Replies)
Discussion started by: PBNOSGT
12 Replies

9. IP Networking

Subnet mask

Hi, I have about 30 computers for users with subnet mask x.x.x.0, and 25 computers for workers with s.m. x.x.x.128. My server has a s.m. x.x.x.128 so with workers computers I can see my server and all the computers in that s.m., but I can't see the server from the users computers and I need to see... (7 Replies)
Discussion started by: Z0DiaC
7 Replies
Login or Register to Ask a Question