#!/bin/bashhostnameip=`/sbin/ifconfig eth0|grep "inet addr:"|sed 's/Bcast.*$//'g |awk -F ":" {'print $2'}`dns=`cat /etc/resolv.conf |grep -v '#'|sed 's/nameserver//'`for i in $ipdo echo "$i"donefor a in $dnsdo echo "$a"done