mirror of
https://github.com/getnamingo/registry.git
synced 2025-05-21 11:59:20 +02:00
Major WHOIS server update
This commit is contained in:
parent
43800b9c15
commit
9fa131f52b
2 changed files with 48 additions and 42 deletions
|
@ -49,6 +49,7 @@ CREATE TABLE IF NOT EXISTS `registry`.`reserved_domain_names` (
|
||||||
CREATE TABLE IF NOT EXISTS `registry`.`registrar` (
|
CREATE TABLE IF NOT EXISTS `registry`.`registrar` (
|
||||||
`id` int(10) unsigned NOT NULL AUTO_INCREMENT,
|
`id` int(10) unsigned NOT NULL AUTO_INCREMENT,
|
||||||
`name` varchar(255) NOT NULL,
|
`name` varchar(255) NOT NULL,
|
||||||
|
`iana_id` int(5) DEFAULT NULL,
|
||||||
`clid` varchar(16) NOT NULL,
|
`clid` varchar(16) NOT NULL,
|
||||||
`pw` varchar(64) NOT NULL,
|
`pw` varchar(64) NOT NULL,
|
||||||
`prefix` char(2) NOT NULL,
|
`prefix` char(2) NOT NULL,
|
||||||
|
|
|
@ -57,19 +57,15 @@ $server->on('receive', function ($server, $fd, $reactorId, $data) {
|
||||||
// Perform the WHOIS lookup
|
// Perform the WHOIS lookup
|
||||||
try {
|
try {
|
||||||
$query = "SELECT *,
|
$query = "SELECT *,
|
||||||
DATE_FORMAT(`crdate`, '%d-%b-%Y %T') AS `crdate`,
|
DATE_FORMAT(`crdate`, '%Y-%m-%dT%H:%i:%sZ') AS `crdate`,
|
||||||
DATE_FORMAT(`update`, '%d-%b-%Y %T') AS `update`,
|
DATE_FORMAT(`update`, '%Y-%m-%dT%H:%i:%sZ') AS `update`,
|
||||||
DATE_FORMAT(`exdate`, '%d-%b-%Y %T') AS `exdate`
|
DATE_FORMAT(`exdate`, '%Y-%m-%dT%H:%i:%sZ') AS `exdate`
|
||||||
FROM `registry`.`domain` WHERE `name` = :domain";
|
FROM `registry`.`domain` WHERE `name` = :domain";
|
||||||
$stmt = $pdo->prepare($query);
|
$stmt = $pdo->prepare($query);
|
||||||
$stmt->bindParam(':domain', $domain, PDO::PARAM_STR);
|
$stmt->bindParam(':domain', $domain, PDO::PARAM_STR);
|
||||||
$stmt->execute();
|
$stmt->execute();
|
||||||
|
|
||||||
if ($f = $stmt->fetch(PDO::FETCH_ASSOC)) {
|
if ($f = $stmt->fetch(PDO::FETCH_ASSOC)) {
|
||||||
if ($f['crdate']) $f['crdate'] .= ' UTC';
|
|
||||||
if ($f['update']) $f['update'] .= ' UTC';
|
|
||||||
if ($f['exdate']) $f['exdate'] .= ' UTC';
|
|
||||||
|
|
||||||
$query2 = "SELECT `tld` FROM `domain_tld` WHERE `id` = :tldid";
|
$query2 = "SELECT `tld` FROM `domain_tld` WHERE `id` = :tldid";
|
||||||
$stmt2 = $pdo->prepare($query2);
|
$stmt2 = $pdo->prepare($query2);
|
||||||
$stmt2->bindParam(':tldid', $f['tldid'], PDO::PARAM_INT);
|
$stmt2->bindParam(':tldid', $f['tldid'], PDO::PARAM_INT);
|
||||||
|
@ -77,7 +73,7 @@ $server->on('receive', function ($server, $fd, $reactorId, $data) {
|
||||||
|
|
||||||
$tld = $stmt2->fetch(PDO::FETCH_ASSOC);
|
$tld = $stmt2->fetch(PDO::FETCH_ASSOC);
|
||||||
|
|
||||||
$query3 = "SELECT `name`,`whois_server`,`url`,`abuse_email`,`abuse_phone` FROM `registrar` WHERE `id` = :clid";
|
$query3 = "SELECT `name`,`iana_id`,`whois_server`,`url`,`abuse_email`,`abuse_phone` FROM `registrar` WHERE `id` = :clid";
|
||||||
$stmt3 = $pdo->prepare($query3);
|
$stmt3 = $pdo->prepare($query3);
|
||||||
$stmt3->bindParam(':clid', $f['clid'], PDO::PARAM_INT);
|
$stmt3->bindParam(':clid', $f['clid'], PDO::PARAM_INT);
|
||||||
$stmt3->execute();
|
$stmt3->execute();
|
||||||
|
@ -86,12 +82,13 @@ $server->on('receive', function ($server, $fd, $reactorId, $data) {
|
||||||
|
|
||||||
$res = "Domain Name: ".strtoupper($f['name'])
|
$res = "Domain Name: ".strtoupper($f['name'])
|
||||||
."\nRegistry Domain ID: ".$f['id']
|
."\nRegistry Domain ID: ".$f['id']
|
||||||
."\nCreated On: ".$f['crdate']
|
|
||||||
."\nLast Updated On: ".$f['update']
|
|
||||||
."\nExpiration Date: ".$f['exdate']
|
|
||||||
."\nRegistrar: ".$clidF['name']
|
|
||||||
."\nRegistrar WHOIS Server: ".$clidF['whois_server']
|
."\nRegistrar WHOIS Server: ".$clidF['whois_server']
|
||||||
."\nRegistrar URL: ".$clidF['url']
|
."\nRegistrar URL: ".$clidF['url']
|
||||||
|
."\nUpdated Date: ".$f['update']
|
||||||
|
."\nCreation Date: ".$f['crdate']
|
||||||
|
."\nRegistry Expiry Date: ".$f['exdate']
|
||||||
|
."\nRegistrar: ".$clidF['name']
|
||||||
|
."\nRegistrar IANA ID: ".$clidF['iana_id']
|
||||||
."\nRegistrar Abuse Contact Email: ".$clidF['abuse_email']
|
."\nRegistrar Abuse Contact Email: ".$clidF['abuse_email']
|
||||||
."\nRegistrar Abuse Contact Phone: ".$clidF['abuse_phone'];
|
."\nRegistrar Abuse Contact Phone: ".$clidF['abuse_phone'];
|
||||||
|
|
||||||
|
@ -101,10 +98,10 @@ $server->on('receive', function ($server, $fd, $reactorId, $data) {
|
||||||
$stmt4->execute();
|
$stmt4->execute();
|
||||||
|
|
||||||
while ($f2 = $stmt4->fetch(PDO::FETCH_ASSOC)) {
|
while ($f2 = $stmt4->fetch(PDO::FETCH_ASSOC)) {
|
||||||
$res .= "\nStatus: ".$f2['status'];
|
$res .= "\nDomain Status: " . $f2['status'] . " https://icann.org/epp#" . $f2['status'];
|
||||||
}
|
}
|
||||||
|
|
||||||
$query5 = "SELECT contact.identifier,contact_postalInfo.name,contact_postalInfo.org,contact_postalInfo.street1,contact_postalInfo.street2,contact_postalInfo.street3,contact_postalInfo.city,contact_postalInfo.sp,contact_postalInfo.pc,contact_postalInfo.cc,contact.voice,contact.voice_x,contact.fax,contact.fax_x,contact.email
|
$query5 = "SELECT contact.identifier,contact_postalInfo.name,contact_postalInfo.org,contact_postalInfo.street1,contact_postalInfo.street2,contact_postalInfo.street3,contact_postalInfo.city,contact_postalInfo.sp,contact_postalInfo.pc,contact_postalInfo.cc,contact.voice,contact.fax,contact.email
|
||||||
FROM contact,contact_postalInfo WHERE contact.id=:registrant AND contact_postalInfo.contact_id=contact.id";
|
FROM contact,contact_postalInfo WHERE contact.id=:registrant AND contact_postalInfo.contact_id=contact.id";
|
||||||
$stmt5 = $pdo->prepare($query5);
|
$stmt5 = $pdo->prepare($query5);
|
||||||
$stmt5->bindParam(':registrant', $f['registrant'], PDO::PARAM_INT);
|
$stmt5->bindParam(':registrant', $f['registrant'], PDO::PARAM_INT);
|
||||||
|
@ -114,20 +111,18 @@ $server->on('receive', function ($server, $fd, $reactorId, $data) {
|
||||||
$res .= "\nRegistry Registrant ID: ".$f2['identifier']
|
$res .= "\nRegistry Registrant ID: ".$f2['identifier']
|
||||||
."\nRegistrant Name: ".$f2['name']
|
."\nRegistrant Name: ".$f2['name']
|
||||||
."\nRegistrant Organization: ".$f2['org']
|
."\nRegistrant Organization: ".$f2['org']
|
||||||
."\nRegistrant Street1: ".$f2['street1']
|
."\nRegistrant Street: ".$f2['street1']
|
||||||
."\nRegistrant Street2: ".$f2['street2']
|
."\nRegistrant Street: ".$f2['street2']
|
||||||
."\nRegistrant Street3: ".$f2['street3']
|
."\nRegistrant Street: ".$f2['street3']
|
||||||
."\nRegistrant City: ".$f2['city']
|
."\nRegistrant City: ".$f2['city']
|
||||||
."\nRegistrant State/Province: ".$f2['sp']
|
."\nRegistrant State/Province: ".$f2['sp']
|
||||||
."\nRegistrant Postal Code: ".$f2['pc']
|
."\nRegistrant Postal Code: ".$f2['pc']
|
||||||
."\nRegistrant Country: ".$f2['cc']
|
."\nRegistrant Country: ".$f2['cc']
|
||||||
."\nRegistrant Phone: ".$f2['voice']
|
."\nRegistrant Phone: ".$f2['voice']
|
||||||
."\nRegistrant Phone Ext.: ".$f2['voice_x']
|
."\nRegistrant Fax: ".$f2['fax']
|
||||||
."\nRegistrant FAX: ".$f2['fax']
|
|
||||||
."\nRegistrant FAX Ext.: ".$f2['fax_x']
|
|
||||||
."\nRegistrant Email: ".$f2['email'];
|
."\nRegistrant Email: ".$f2['email'];
|
||||||
|
|
||||||
$query6 = "SELECT contact.identifier,contact_postalInfo.name,contact_postalInfo.org,contact_postalInfo.street1,contact_postalInfo.street2,contact_postalInfo.street3,contact_postalInfo.city,contact_postalInfo.sp,contact_postalInfo.pc,contact_postalInfo.cc,contact.voice,contact.voice_x,contact.fax,contact.fax_x,contact.email
|
$query6 = "SELECT contact.identifier,contact_postalInfo.name,contact_postalInfo.org,contact_postalInfo.street1,contact_postalInfo.street2,contact_postalInfo.street3,contact_postalInfo.city,contact_postalInfo.sp,contact_postalInfo.pc,contact_postalInfo.cc,contact.voice,contact.fax,contact.email
|
||||||
FROM domain_contact_map,contact,contact_postalInfo WHERE domain_contact_map.domain_id=:domain_id AND domain_contact_map.type='admin' AND domain_contact_map.contact_id=contact.id AND domain_contact_map.contact_id=contact_postalInfo.contact_id";
|
FROM domain_contact_map,contact,contact_postalInfo WHERE domain_contact_map.domain_id=:domain_id AND domain_contact_map.type='admin' AND domain_contact_map.contact_id=contact.id AND domain_contact_map.contact_id=contact_postalInfo.contact_id";
|
||||||
$stmt6 = $pdo->prepare($query6);
|
$stmt6 = $pdo->prepare($query6);
|
||||||
$stmt6->bindParam(':domain_id', $f['id'], PDO::PARAM_INT);
|
$stmt6->bindParam(':domain_id', $f['id'], PDO::PARAM_INT);
|
||||||
|
@ -137,20 +132,18 @@ $server->on('receive', function ($server, $fd, $reactorId, $data) {
|
||||||
$res .= "\nRegistry Admin ID: ".$f2['identifier']
|
$res .= "\nRegistry Admin ID: ".$f2['identifier']
|
||||||
."\nAdmin Name: ".$f2['name']
|
."\nAdmin Name: ".$f2['name']
|
||||||
."\nAdmin Organization: ".$f2['org']
|
."\nAdmin Organization: ".$f2['org']
|
||||||
."\nAdmin Street1: ".$f2['street1']
|
."\nAdmin Street: ".$f2['street1']
|
||||||
."\nAdmin Street2: ".$f2['street2']
|
."\nAdmin Street: ".$f2['street2']
|
||||||
."\nAdmin Street3: ".$f2['street3']
|
."\nAdmin Street: ".$f2['street3']
|
||||||
."\nAdmin City: ".$f2['city']
|
."\nAdmin City: ".$f2['city']
|
||||||
."\nAdmin State/Province: ".$f2['sp']
|
."\nAdmin State/Province: ".$f2['sp']
|
||||||
."\nAdmin Postal Code: ".$f2['pc']
|
."\nAdmin Postal Code: ".$f2['pc']
|
||||||
."\nAdmin Country: ".$f2['cc']
|
."\nAdmin Country: ".$f2['cc']
|
||||||
."\nAdmin Phone: ".$f2['voice']
|
."\nAdmin Phone: ".$f2['voice']
|
||||||
."\nAdmin Phone Ext.: ".$f2['voice_x']
|
."\nAdmin Fax: ".$f2['fax']
|
||||||
."\nAdmin FAX: ".$f2['fax']
|
|
||||||
."\nAdmin FAX Ext.: ".$f2['fax_x']
|
|
||||||
."\nAdmin Email: ".$f2['email'];
|
."\nAdmin Email: ".$f2['email'];
|
||||||
|
|
||||||
$query7 = "SELECT contact.identifier,contact_postalInfo.name,contact_postalInfo.org,contact_postalInfo.street1,contact_postalInfo.street2,contact_postalInfo.street3,contact_postalInfo.city,contact_postalInfo.sp,contact_postalInfo.pc,contact_postalInfo.cc,contact.voice,contact.voice_x,contact.fax,contact.fax_x,contact.email
|
$query7 = "SELECT contact.identifier,contact_postalInfo.name,contact_postalInfo.org,contact_postalInfo.street1,contact_postalInfo.street2,contact_postalInfo.street3,contact_postalInfo.city,contact_postalInfo.sp,contact_postalInfo.pc,contact_postalInfo.cc,contact.voice,contact.fax,contact.email
|
||||||
FROM domain_contact_map,contact,contact_postalInfo WHERE domain_contact_map.domain_id=:domain_id AND domain_contact_map.type='billing' AND domain_contact_map.contact_id=contact.id AND domain_contact_map.contact_id=contact_postalInfo.contact_id";
|
FROM domain_contact_map,contact,contact_postalInfo WHERE domain_contact_map.domain_id=:domain_id AND domain_contact_map.type='billing' AND domain_contact_map.contact_id=contact.id AND domain_contact_map.contact_id=contact_postalInfo.contact_id";
|
||||||
$stmt7 = $pdo->prepare($query7);
|
$stmt7 = $pdo->prepare($query7);
|
||||||
$stmt7->bindParam(':domain_id', $f['id'], PDO::PARAM_INT);
|
$stmt7->bindParam(':domain_id', $f['id'], PDO::PARAM_INT);
|
||||||
|
@ -160,20 +153,18 @@ $server->on('receive', function ($server, $fd, $reactorId, $data) {
|
||||||
$res .= "\nRegistry Billing ID: ".$f2['identifier']
|
$res .= "\nRegistry Billing ID: ".$f2['identifier']
|
||||||
."\nBilling Name: ".$f2['name']
|
."\nBilling Name: ".$f2['name']
|
||||||
."\nBilling Organization: ".$f2['org']
|
."\nBilling Organization: ".$f2['org']
|
||||||
."\nBilling Street1: ".$f2['street1']
|
."\nBilling Street: ".$f2['street1']
|
||||||
."\nBilling Street2: ".$f2['street2']
|
."\nBilling Street: ".$f2['street2']
|
||||||
."\nBilling Street3: ".$f2['street3']
|
."\nBilling Street: ".$f2['street3']
|
||||||
."\nBilling City: ".$f2['city']
|
."\nBilling City: ".$f2['city']
|
||||||
."\nBilling State/Province: ".$f2['sp']
|
."\nBilling State/Province: ".$f2['sp']
|
||||||
."\nBilling Postal Code: ".$f2['pc']
|
."\nBilling Postal Code: ".$f2['pc']
|
||||||
."\nBilling Country: ".$f2['cc']
|
."\nBilling Country: ".$f2['cc']
|
||||||
."\nBilling Phone: ".$f2['voice']
|
."\nBilling Phone: ".$f2['voice']
|
||||||
."\nBilling Phone Ext.: ".$f2['voice_x']
|
."\nBilling Fax: ".$f2['fax']
|
||||||
."\nBilling FAX: ".$f2['fax']
|
|
||||||
."\nBilling FAX Ext.: ".$f2['fax_x']
|
|
||||||
."\nBilling Email: ".$f2['email'];
|
."\nBilling Email: ".$f2['email'];
|
||||||
|
|
||||||
$query8 = "SELECT contact.identifier,contact_postalInfo.name,contact_postalInfo.org,contact_postalInfo.street1,contact_postalInfo.street2,contact_postalInfo.street3,contact_postalInfo.city,contact_postalInfo.sp,contact_postalInfo.pc,contact_postalInfo.cc,contact.voice,contact.voice_x,contact.fax,contact.fax_x,contact.email
|
$query8 = "SELECT contact.identifier,contact_postalInfo.name,contact_postalInfo.org,contact_postalInfo.street1,contact_postalInfo.street2,contact_postalInfo.street3,contact_postalInfo.city,contact_postalInfo.sp,contact_postalInfo.pc,contact_postalInfo.cc,contact.voice,contact.fax,contact.email
|
||||||
FROM domain_contact_map,contact,contact_postalInfo WHERE domain_contact_map.domain_id=:domain_id AND domain_contact_map.type='tech' AND domain_contact_map.contact_id=contact.id AND domain_contact_map.contact_id=contact_postalInfo.contact_id";
|
FROM domain_contact_map,contact,contact_postalInfo WHERE domain_contact_map.domain_id=:domain_id AND domain_contact_map.type='tech' AND domain_contact_map.contact_id=contact.id AND domain_contact_map.contact_id=contact_postalInfo.contact_id";
|
||||||
$stmt8 = $pdo->prepare($query8);
|
$stmt8 = $pdo->prepare($query8);
|
||||||
$stmt8->bindParam(':domain_id', $f['id'], PDO::PARAM_INT);
|
$stmt8->bindParam(':domain_id', $f['id'], PDO::PARAM_INT);
|
||||||
|
@ -183,17 +174,15 @@ $server->on('receive', function ($server, $fd, $reactorId, $data) {
|
||||||
$res .= "\nRegistry Tech ID: ".$f2['identifier']
|
$res .= "\nRegistry Tech ID: ".$f2['identifier']
|
||||||
."\nTech Name: ".$f2['name']
|
."\nTech Name: ".$f2['name']
|
||||||
."\nTech Organization: ".$f2['org']
|
."\nTech Organization: ".$f2['org']
|
||||||
."\nTech Street1: ".$f2['street1']
|
."\nTech Street: ".$f2['street1']
|
||||||
."\nTech Street2: ".$f2['street2']
|
."\nTech Street: ".$f2['street2']
|
||||||
."\nTech Street3: ".$f2['street3']
|
."\nTech Street: ".$f2['street3']
|
||||||
."\nTech City: ".$f2['city']
|
."\nTech City: ".$f2['city']
|
||||||
."\nTech State/Province: ".$f2['sp']
|
."\nTech State/Province: ".$f2['sp']
|
||||||
."\nTech Postal Code: ".$f2['pc']
|
."\nTech Postal Code: ".$f2['pc']
|
||||||
."\nTech Country: ".$f2['cc']
|
."\nTech Country: ".$f2['cc']
|
||||||
."\nTech Phone: ".$f2['voice']
|
."\nTech Phone: ".$f2['voice']
|
||||||
."\nTech Phone Ext.: ".$f2['voice_x']
|
."\nTech Fax: ".$f2['fax']
|
||||||
."\nTech FAX: ".$f2['fax']
|
|
||||||
."\nTech FAX Ext.: ".$f2['fax_x']
|
|
||||||
."\nTech Email: ".$f2['email'];
|
."\nTech Email: ".$f2['email'];
|
||||||
|
|
||||||
$query9 = "SELECT `name` FROM `domain_host_map`,`host` WHERE `domain_host_map`.`domain_id` = :domain_id AND `domain_host_map`.`host_id` = `host`.`id`";
|
$query9 = "SELECT `name` FROM `domain_host_map`,`host` WHERE `domain_host_map`.`domain_id` = :domain_id AND `domain_host_map`.`host_id` = `host`.`id`";
|
||||||
|
@ -209,7 +198,23 @@ $server->on('receive', function ($server, $fd, $reactorId, $data) {
|
||||||
$counter++;
|
$counter++;
|
||||||
}
|
}
|
||||||
|
|
||||||
$res .= "\nDNSSEC: Unsigned";
|
$query_dnssec = "SELECT EXISTS(SELECT 1 FROM `secdns` WHERE `domain_id` = :domain_id)";
|
||||||
|
$stmt_dnssec = $pdo->prepare($query_dnssec);
|
||||||
|
$stmt_dnssec->bindParam(':domain_id', $f['id'], PDO::PARAM_INT);
|
||||||
|
$stmt_dnssec->execute();
|
||||||
|
|
||||||
|
$dnssec_exists = $stmt_dnssec->fetchColumn();
|
||||||
|
|
||||||
|
if ($dnssec_exists) {
|
||||||
|
$res .= "\nDNSSEC: signedDelegation";
|
||||||
|
} else {
|
||||||
|
$res .= "\nDNSSEC: unsigned";
|
||||||
|
}
|
||||||
|
$res .= "\nURL of the ICANN Whois Inaccuracy Complaint Form: https://www.icann.org/wicf/";
|
||||||
|
$currentTimestamp = date('Y-m-d\TH:i:s\Z');
|
||||||
|
$res .= "\n>>> Last update of WHOIS database: {$currentTimestamp} <<<";
|
||||||
|
$res .= "\n";
|
||||||
|
$res .= "\nFor more information on Whois status codes, please visit https://icann.org/epp";
|
||||||
$res .= "\n\n";
|
$res .= "\n\n";
|
||||||
$res .= "Access to {$tld['tld']} WHOIS information is provided to assist persons in"
|
$res .= "Access to {$tld['tld']} WHOIS information is provided to assist persons in"
|
||||||
."\ndetermining the contents of a domain name registration record in the"
|
."\ndetermining the contents of a domain name registration record in the"
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue