I'm starting to provide Chinese / English versions of some posts, switch with the Language menu above. 我开始提供部分文章的中文、英文翻译,请使用顶部语言菜单切换。

Lookup Any Public WHOIS with this nginx-based Server

After I set up a DN42 WHOIS server with nginx, I configured my DN42 Looking Glass to use this service. As my Looking Glass is capable of running as a Telegram bot, fellow group members are looking up WHOIS information of IPs and domains with it.But soon we noticed a problem. A significant part of members have applied for ASN and IP ranges on the public Internet after they're familiar enough with DN42, and they're peering at Internet Exchange Points. Therefore, they often need to lookup some public Internet IPs, ASNs and domains, yet none of the Telegram bots in our group can do so. It would be quite helpful for us if there exists a WHOIS server that proxies lookups to relevant registries.Proxying is exactly what nginx is good at....

Setting up DN42 WHOIS Server with nginx

In my previous post "Setting up Gopher Site with nginx", I mentioned that the Gopher service is a byproduct of my original plan: modifying nginx into a WHOIS server for DN42. This post will explore into details of that process.The WHOIS Protocol ¶First, we can find a WHOIS server to observe its response. Choose the WHOIS server for .pub domain for example, and run telnet whois.nic.pub 43:# Type following line and hit enterlantian.pub# WHOIS server responded with:Domain Name: lantian.pubRegistry Domain ID: c69e5ccf9d834900be26f88fddc5c9e4-DONUTSRegistrar WHOIS Server: whois.dnspod.cnRegistrar URL: https://www.dnspod.cnUpdated Date: 2021-01-07T14:09:11ZCreation Date: 2016-10-23T08:36:41ZRegistry Expiry Date: 2029-10-23T08:36:41ZRegistrar: DNSPod, Inc....