n/programu/runoneall · 7 个月前
注册 登录
n/program · 7 个月前 · 已编辑 · 430 次浏览
u/runoneall王者

我制作了一个伪 DNL 的 whois 服务器

起因是,我把 whois.rr.kg 这个域名抢了,然后打算写点什么...

成品展示:https://whois.rr.kg/

服务跑在 Serv00 上

源代码:

import express from "express";
import ejs from "ejs";

const app = express();

app.engine("ejstxt", ejs.renderFile);
app.set("view engine", "ejstxt");
app.use(express.static("public"));

app.get("/:domain", async (req, res) => {
  const domain = req.params.domain;
  const whoisServer = "https://domain.nodeloc.com/api/public/whois/";
  const currentHost = req.get("host");

  res.header("Content-Type", "text/plain; charset=utf-8");

  try {
    const resp = await fetch(whoisServer + domain);
    const data = await resp.json();

    if (data.error) {
      return res.status(400).send(`Error: ${data.error}`);
    }

    res.render("template.ejstxt", {
      data: data,
      host: currentHost,
      timestamp: new Date().toISOString(),
    });
  } catch (error) {
    console.error(error);
    res.status(500).send("Internal Server Error");
  }
});

app.listen(3000, () => console.log("Server started"));
Domain Name: <%= data.full_domain || "N/A" %>
Registry Domain ID: NOT_APPLICABLE 
Registrar WHOIS Server: <%= host %> 
Registrar URL: https://domain.nodeloc.com 
Updated Date: <%= data.registered_at || "N/A" %> 
Creation Date: <%= data.registered_at || "N/A" %> 
Registry Expiry Date: <%= data.expires_at || "N/A" %> 
Registrar: Nodeloc Free Domain
Registrar IANA ID: Not Provided
Domain Status: <%= data.status || "inactive" %> (https://icann.org/epp#<%= data.status || "inactive" %>)

Registry Registrant ID: REDACTED_FOR_PRIVACY
Registrant Name: REDACTED_FOR_PRIVACY
Registrant Organization: REDACTED_FOR_PRIVACY

<% if (data.nameservers && data.nameservers.length > 0) { -%>
<% data.nameservers.forEach(ns => { -%>
Name Server: <%= ns %>
<% }); -%>
<% } else { -%>
Name Server: Not Provided
<% } -%>

DNSSEC: unsigned

---
### Additional System Metadata ###
Days Until Deletion: <%= data.days_until_deletion ?? "null" %>
Days Until Suspension: <%= data.days_until_suspension ?? "null" %>
First Failed At: <%= data.first_failed_at ?? "null" %>
Suspension Reason: <%= data.suspend_reason ?? "null" %>
Suspended At: <%= data.suspended_at ?? "null" %>

### Health & Scan Reports ###
<% if (data.scan) { -%>
Overall Health: <%= data.scan.overall_health || "N/A" %>
DNS Status: <%= data.scan.dns_status || "N/A" %>
HTTP Status: <%= data.scan.http_status || "N/A" %>
SSL Status: <%= data.scan.ssl_status || "N/A" %>
Safe Browsing: <%= data.scan.safe_browsing_status || "N/A" %>
VirusTotal: <%= data.scan.virustotal_status || "N/A" %>
Uptime: <%= data.scan.uptime_percentage ? data.scan.uptime_percentage.toFixed(2) + "%" : "N/A" %>
Last Scanned: <%= data.scan.last_scanned_at || "N/A" %>
<% } else { -%>
Scan Status: No scan data available
<% } -%>

>>> Last update of WHOIS database: <%= timestamp %> <<<
6
16
登录后参与讨论。
u/udc2b6nr 广告
QuicksilverVPN

快银 VPN,一键连接全球节点,线路稳定、延迟低。支持 Windows、macOS 等多平台,TUN 全局模式覆盖全部应用流量。无需复杂配置,下载即用。

umami.dnsl.top 了解更多

16 条回复

排序
  1. cs9u 钻石 钻石会员 7 个月前

    ch查不到呢

    3
  2. runoneall 王者 楼主 7 个月前

    哪个域名?我用的是官方的 api,有一些很特殊的域名似乎就是查不到

    0
  3. runoneall 王者 楼主 7 个月前 已编辑

    https://whois.rr.kg/domain/ch.loc.cc

    应该是这个吧,可以查到的

    0
  4. cs9u 钻石 钻石会员 7 个月前

    是我没有仔细看,原来只能查loc.cc的二级域名。
    是说我查.163.com查不到哦。

    0
  5. runoneall 王者 楼主 7 个月前 已编辑

    因为是 DNL 的 whois 服务器()

    0
  6. bashell 钻石 7 个月前

    膜拜大佬

    2
  7. Serendipity1 钻石 7 个月前

    厉害厉害

    2
  8. Seraphina 钻石 7 个月前

    :xhj003: 赞啊

    2
  9. hakd 钻石 2 YEARS 7 个月前

    这页面真是返璞归真啊,直击痛点

    1
  10. qiang 白银 7 个月前

    不错的内容,Mark

    1
  11. lovoup 钻石 3 YEARS 7 个月前

    谢谢分享

    0
  12. James 💯 王者 MANAGER 7 个月前

    @imgload 呆哥也弄了一个的。

    0
  13. imgload 白银 大神 7 个月前

    :ac01:再给坛友分享一下脚本https://www.nodeloc.com/t/topic/78335
    支持查询国际互联网1500+域名后缀与.loc.cc后缀
    image

    1
  14. runoneall 王者 楼主 7 个月前

    这个真支持,发现好东西了

    0
  15. dj56959566 黄金 不离不弃 7 个月前

    感谢分享!

    0
  16. semilas 黄金 7 个月前

    必须支持,赞

    0