jrwhois.p5 uses the address utilization data maintained by our jcidr.p5 tool and an SQL table containing data about your customers. We can also import assignment data from clients' databases.
In order for jrwhois.p5 to be useful, you must regularly update it with data about the customers to whom you assign IP space. This data must include their company name, address, city, state or province, country, and postal code; and may optionally contain an email address and telephone number(s).
Although we are happy to customize jrwhois.p5 to suit the needs of our clients, we prefer to use data in either the below CSV file format, or the below SQL table structure. It is really our preference that CSV files have the columns seperated by tab (0x09 or \t) characters, as that will allow you to export data containing commas without enclosing the columnar data in quotation marks. True commas have been used for illustration only.
Example Comma Seperated Value file
jsw@odyssey:~ 84% cat ex.csv custid,name,addr1,addr2,addr3,city,state,zip,country,email,phone 1,Ex Inc.,100 Example Ave,,Louisville,KY,40201,US,support@example.com,502-555-1000
Preferred SQL Table Format
mysql> DESCRIBE Swip; +---------+-------------+------+-----+---------+-------+ | Field | Type | Null | Key | Default | Extra | +---------+-------------+------+-----+---------+-------+ | custid | varchar(24) | | PRI | | | | name | tinytext | YES | | NULL | | | addr1 | tinytext | YES | | NULL | | | addr2 | tinytext | YES | | NULL | | | addr3 | tinytext | YES | | NULL | | | city | tinytext | YES | | NULL | | | state | tinytext | YES | | NULL | | | zip | tinytext | YES | | NULL | | | country | tinytext | YES | | NULL | | | email | tinytext | YES | | NULL | | | phone | tinytext | YES | | NULL | | +---------+-------------+------+-----+---------+-------+ 8 rows in set (0.00 sec)
Example /etc/jrwhois.conf configuration file
jsw@odyssey:~ 84% cat /etc/jrwhois.conf
{
dsn => "DBI:mysql:rwhois_database;localhost",
user => "rwhois_username",
pass => "rwhois_password",
}
Example /etc/xinetd.d/rwhois configuration file
jsw@odyssey:~ 85% cat /etc/xinetd.d/rwhois
service rwhois
{
disable = no
bind = 1.2.3.4
port = 4321
flags = NORETRY
socket_type = stream
protocol = tcp
wait = no
user = rwhois
group = rwhois
instances = 10
per_source = 3
max_load = 5.0
rlimit_as = 20M
rlimit_cpu = 60
log_type = FILE /var/log/xinetd.log
log_on_success = PID HOST USERID EXIT DURATION
log_on_failure = HOST USERID ATTEMPT
server = /usr/local/sbin/jrwhois.p5
server_args = --timeout 60 --logfile /var/log/rwhois.log --clientDb ex --hostname rwhois.example.com --admin noreply@inconcepts.biz
}
Example Query
Below is an example query using a standard command line whois client.
jsw@odyssey:~ 94% whois -hrwhois.example.com -p4321 192.168.186.240/29 network:Class-Name:network network:Auth-Area:192.168.186.0/23 network:ID:3232283376/29 network:Handle:CUSTBLK-192-168-186-240-29 network:IP-Network:192.168.186.240/29 network:IP-Network-Block:192.168.186.240 - 192.168.186.247 network:Org-Name:Customer of Example Internet network:Street-Address:255 Fictional Blvd network:City:Louisville network:State:KY network:Postal-Code:40201 network:Country-Code:US network:Class-Name:network network:Auth-Area:192.168.186.0/23 network:ID:3232283136/23 network:Handle:192.168.186.0/23 network:IP-Network:192.168.186.0/23 network:IP-Network-Block:192.168.186.0 - 192.168.187.255 %ok searched for 192.168.186.240/29 3232283376 and found 2 records
