LinuxQuestions.org
Help answer threads with 0 replies.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices


Reply
  Search this Thread
Old 12-31-2009, 07:51 AM   #1
Artanicus
Member
 
Registered: Jan 2005
Location: Finland
Distribution: Ubuntu, Debian, Gentoo, Slackware
Posts: 827

Rep: Reputation: 31
Question CLI whois filtering & cleanup?


I use whois constantly at work (about 30 queries a day on average) and starting to get a bit fed up with all the unnessesary information in each response. Now, I wrote a simple script to parse whois.verisign-grs.com results (jwhois default nowadays) which was simple due to them having key: value -fields. However, for whatever reason, Verisign leaves out all registrant information, which is rather vital. A proper internic query gives all relevant information but in a horrible format, no clean way to parse. (examples of both queries included at bottom)

So, what do you guys and gals use as your whois server chain, and anyone else filtering them, perhaps more successfully? My current line is as simple as:
Code:
whois $@ | grep \: | grep -v NOTICE | grep -v TERMS | grep -v 'terms of use' | grep -v 'to: ' | grep -v competing | grep -v "More information"
And here are the promised query response examples:
Quote:
$ whois verizon.com
[Querying whois.verisign-grs.com]
[whois.verisign-grs.com]

Whois Server Version 2.0

Domain names in the .com and .net domains can now be registered
with many different competing registrars. Go to http://www.internic.net
for detailed information.

Domain Name: VERIZON.COM
Registrar: MARKMONITOR INC.
Whois Server: whois.markmonitor.com
Referral URL: http://www.markmonitor.com
Name Server: ASIA3.AKAM.NET
Name Server: DNS2.VERIZON.COM
Name Server: EUR1.AKAM.NET
Name Server: EUR2.AKAM.NET
Name Server: NS1-110.AKAM.NET
Name Server: NS1-111.AKAM.NET
Name Server: USC1.AKAM.NET
Name Server: USE1.AKAM.NET
Name Server: USW2.AKAM.NET
Name Server: VZDNS01.VERIZON.COM
Status: clientDeleteProhibited
Status: clientTransferProhibited
Status: clientUpdateProhibited
Updated Date: 02-feb-2009
Creation Date: 06-mar-2000
Expiration Date: 06-mar-2011

>>> Last update of whois database: Thu, 31 Dec 2009 13:46:24 UTC <<<

NOTICE: The expiration date displayed in this record is the date the
registrar's sponsorship of the domain name registration in the registry is
currently set to expire. This date does not necessarily reflect the expiration
date of the domain name registrant's agreement with the sponsoring
registrar. Users may consult the sponsoring registrar's Whois database to
view the registrar's reported date of expiration for this registration.

TERMS OF USE: You are not authorized to access or query our Whois
database through the use of electronic processes that are high-volume and
automated except as reasonably necessary to register domain names or
modify existing registrations; the Data in VeriSign Global Registry
Services' ("VeriSign") Whois database is provided by VeriSign for
information purposes only, and to assist persons in obtaining information
about or related to a domain name registration record. VeriSign does not
guarantee its accuracy. By submitting a Whois query, you agree to abide
by the following terms of use: You agree that you may use this Data only
for lawful purposes and that under no circumstances will you use this Data
to: (1) allow, enable, or otherwise support the transmission of mass
unsolicited, commercial advertising or solicitations via e-mail, telephone,
or facsimile; or (2) enable high volume, automated, electronic processes
that apply to VeriSign (or its computer systems). The compilation,
repackaging, dissemination or other use of this Data is expressly
prohibited without the prior written consent of VeriSign. You agree not to
use electronic processes that are automated and high-volume to access or
query the Whois database except as reasonably necessary to register
domain names or modify existing registrations. VeriSign reserves the right
to restrict your access to the Whois database in its sole discretion to ensure
operational stability. VeriSign may restrict or terminate your access to the
Whois database for failure to abide by these terms of use. VeriSign
reserves the right to modify these terms at any time.

The Registry database contains ONLY .COM, .NET, .EDU domains and
Registrars.
Quote:
$ whois -h whois.internic.net verizon.com
[Querying whois.internic.net]
[Redirected to whois.markmonitor.com]
[Querying whois.markmonitor.com]
[whois.markmonitor.com]

MarkMonitor is the Global Leader in Enterprise Brand Protection.

Domain Management
MarkMonitor Brand Protection™
AntiFraud Solutions
Corporate Consulting Services

Visit MarkMonitor at www.markmonitor.com
Contact us at 1 800 745 9229
In Europe, at +44 (0) 20 7840 1300


The Data in MarkMonitor.com's WHOIS database is provided by MarkMonitor.com
for information purposes, and to assist persons in obtaining information
about or related to a domain name registration record. MarkMonitor.com
does not guarantee its accuracy. By submitting a WHOIS query, you agree
that you will use this Data only for lawful purposes and that, under no
circumstances will you use this Data to: (1) allow, enable, or otherwise
support the transmission of mass unsolicited, commercial advertising or
solicitations via e-mail (spam); or (2) enable high volume, automated,
electronic processes that apply to MarkMonitor.com (or its systems).
MarkMonitor.com reserves the right to modify these terms at any time.
By submitting this query, you agree to abide by this policy.

Registrant:
Verizon Trademark Services LLC
Verizon Trademark Services LLC
1320 North Court House Road
Arlington VA 22201
US
domainlegalcontact@verizon.com +1.7033513164 Fax: +1.7033513669

Domain Name: verizon.com

Registrar Name: Markmonitor.com
Registrar Whois: whois.markmonitor.com
Registrar Homepage: http://www.markmonitor.com

Administrative Contact:
Domain Administrator
Verizon Trademark Services LLC
1320 North Court House Road
Arlington VA 22201
US
domainlegalcontact@verizon.com +1.7033513164 Fax: +1.7033513669
Technical Contact, Zone Contact:
Domain Technician
Verizon
1320 North Court House Road
Arlington VA 22201
US
sysmgr@verizon.com +1.7033513164 Fax: +1.7033513669

Created on..............: 2000-03-06.
Expires on..............: 2011-03-06.
Record last updated on..: 2009-05-30.

Domain servers in listed order:

ns1-110.akam.net
usc1.akam.net
vzdns01.verizon.com
use1.akam.net
eur1.akam.net
asia3.akam.net
usw2.akam.net
ns1-111.akam.net
dns2.verizon.com
eur2.akam.net




MarkMonitor is the Global Leader in Enterprise Brand Protection.

Domain Management
MarkMonitor Brand Protection™
AntiFraud Solutions
Corporate Consulting Services

Visit MarkMonitor at www.markmonitor.com
Contact us at 1 800 745 9229
In Europe, at +44 (0) 20 7840 1300
 
Old 12-31-2009, 08:41 AM   #2
voyciz
Member
 
Registered: Mar 2004
Distribution: Slackware
Posts: 425

Rep: Reputation: 40
I think gawk would be your friend here. I'm not exactly sure what you're trying to do, and I'm not too familiar with awk either, but something like this would pull out just the Registrant info from that example text you posted.
Code:
BEGIN { trip=0 }
{
if ($1 == "Registrant:")
        trip=1
if(trip == 1)
        print $0
if ($1 == "Domain")
        trip=0
}
You would save that as a script and then do
$ whois $@ | awk -f SCRIPT
 
Old 01-01-2010, 12:58 PM   #3
Artanicus
Member
 
Registered: Jan 2005
Location: Finland
Distribution: Ubuntu, Debian, Gentoo, Slackware
Posts: 827

Original Poster
Rep: Reputation: 31
Seems awk might be the way to go, I keep forgetting how powerful it is.

My ultimate goal is to get consistent, condensed, easy to read information on .com/.net/.org/.eu/.fi domains without the adverts, disclaimers, terms of use and other useless information. Registrar, registrant, nameservers, register, update and expire times. Not for machine use, just for human eyes in a hurry.

But if anyone knows any good open whois service for com/net, I'm all ears. VeriSign doesn't include enough information and internic will bounce you bad sometimes, just look at 'whois -h whois.internic.net google.com'
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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



Similar Threads
Thread Thread Starter Forum Replies Last Post
filtering spam & sylpheed linuxhippy Slackware 4 11-01-2006 10:53 AM
cli php & gd janakvi Linux - Software 0 09-12-2006 02:47 AM
Ubuntu & Content Filtering davidbee Linux - Newbie 1 05-22-2005 05:25 PM
Cli & Kvm. mdarby Slackware 11 05-10-2005 09:02 PM
CLI filesharing filtering by album goofyheadedpunk Linux - Software 4 07-02-2004 10:53 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 02:10 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration