Linux - GeneralThis 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
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
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:
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.
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
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.
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
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'
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.