The UNIX and Linux Forums  


Go Back   The UNIX and Linux Forums > Top Forums > Shell Programming and Scripting
.
grep unix.com with google



Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts and shell scripting languages here.

Reply
English Japanese Spanish French German Portuguese Italian Powered by Powered by Google
 
Thread Tools Search this Thread Rate Thread Display Modes
  #1 (permalink)  
Old 12-01-2009
Registered User
 

Join Date: Sep 2008
Posts: 3
Where are my sites hosted?

I have 5 public websites (2 different datacenters)
1. production datacenter
2. Backup datacenter.

I have a global site selector which will load balance the site based on availability and load. I would like to have a script that can tell me exactly where my sites are in 2 columns.

example....

www.site1.com 10.1.1.1 (public IPs of course)
www.site2.com 172.16.0.0 (public IPs of course)

Thanks in advance for your help.

I'm using ubuntu 9.10

Last edited by kmaq7621; 12-01-2009 at 11:08 AM.. Reason: Removed automatic url tags.
  #2 (permalink)  
Old 12-01-2009
Registered User
 

Join Date: Jun 2006
Posts: 468
hits: arrange the result with nslookup


Code:
nslookup www.site1.com

  #3 (permalink)  
Old 12-02-2009
Registered User
 

Join Date: Sep 2008
Posts: 3
figured it out.

#!/bin/bash
# where_are_you.sh
#do a dig against the public DNS servers and spit out the current IP of the sites.
array=( www.site1.com
www.site2.com
www.site3.com
)

for i in "${array[@]}"
do
dig @4.2.2.2 $i a | grep -v ';' |grep $i | awk '{print $5," "$1}'
done
Sponsored Links
Reply

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
Broker BGC Offers Hosted Co-Located CEP to Clients Linux Bot Complex Event Processing RSS News 0 03-14-2009 06:40 PM
Part 2: Configure and Use ZFS-Hosted iSCSI Guest Storage Within the Sun xVM Hyperviso Linux Bot Solaris BigAdmin RSS 0 09-17-2008 09:10 AM
to stop the website hosted in apache ux server kishan HP-UX 1 04-09-2008 09:50 AM
Accessing a FTP Server hosted on Linux Breen IP Networking 1 03-16-2005 05:35 AM
Writing a .NET service to be Hosted in UNIX yeslekmc High Level Programming 0 05-21-2002 07:03 PM



All times are GMT -4. The time now is 02:26 PM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited. Language Translations Powered by .
vBCredits v1.4 Copyright ©2007 - 2008, PixelFX Studios
The UNIX and Linux Forums Content Copyright ©1993-2009. All Rights Reserved.Ad Management by RedTyger

Content Relevant URLs by vBSEO 3.2.0