Different output per TLDs
Brought to you by:
zerosys
Hi,
I'm currently using JWhoisServer with multiple TLDs including gTLDs. Is it possible to setup the server in such a way that the output is different depending on the tld? e.g. .com.au can't show much details but .com can show nearly everything.
I've tried messing around with .objectlookup and making it .match certain TLDs but the regex doesn't seem to be working.
Cheers
Rob
Hello
In fact using some funny hack with objectlookup and db.$OBJECTNAME.match may work.
Another more flexible way to customize the output would be to use velocity templates.
And as a third way you can use views at a DB level.
And finally you can implement your own display class as a plugin and configure it's use via db.$OBJECTNAME.dspobj. You can use the inetlookup stuff as a example: http://jwhoisserver.sourceforge.net/#configadvanced_inetlookup
So I am quite sure that at least one approach should lead to the desired output. The server was designed to be flexible at a max, but unfortunately this makes configuring it sometimes complicated, but at least you have the option to configure it.
Sorry, but providing a complete solution here is currently exceeding my resources.
Wish you good luck and happy hacking
Klaus
Thank you for the prompt reply, I've been trying to use the db.$OBJECTNAME.match method, but I keep hitting a wall with the lookup, I've included a section of the config below.
If I set the regex on the domain_au.match and leave the domain_all.match as unset all the requests are catched by the domain_all object, if I don't have the domain_all object in the db.objectlist all the .com.au request display fine but any other request returns a syntax error.
I think the rest of the config should be easy once I'm past this issue. Any advice?
Regards
Rob
default lookup
db.objectlookupdefault=domain
include inetnum by default:
db.objectlist=domain_au;domain_all;
db.domain_all.table=domain
db.domain_all.qfield=name
db.domain_all.key=id
db.domain_all.whereaddition=
db.domain_all.display=name as 'Domain Name'; 'com 1' as 'Type'
db.domain_all.objectlookup=domain
db.domain_all.match=
db.domain_au.table=domain
db.domain_au.qfield=name
db.domain_au.key=id
db.domain_au.whereaddition=
db.domain_au.display=name as 'Domain Name'; 'au 1' as 'Type'
db.domain_au.objectlookup=domain
db.domain_au.match=^(?:a-z0-9{0,61}[a-z0-9]?.)+(com.au)$