# WHOIS Lookup Utility untuk TLD, gTLD, ccTLD dan mTLD dengan Menggunakan Telegram Bot

<figure><img src="https://nos.wjv-1.neo.id/cdn.medusa.my.id/Whois%20Bot.png" alt=""><figcaption></figcaption></figure>

## Introduction

Berikut ini adalah tulisan mengenai bagaimana cara untuk melakukan query data whois domain dalam kategori TLD yang dikelola oleh Internet Assigned Numbers Authority (IANA) seperti TLD, gTLD, ccTLD dan mTLD dengan memanfaatkan bantuan dari Telegram Bot, yang mana bot ini dibuat dengan menggunakan bahasa pemrograman [**PHP (Hypertext Preprocessor)**](https://www.php.net).

Dengan adanya bot ini diharapkan dapat memudahkan proses pencarian nama domain yang ingin dicari dengan mengetikkan satu perintah saja.

## Requirements

* [**Git**](https://git-scm.com/downloads).
* [**Nginx**](http://nginx.org/en/download.html).
* [**PHP-FPM**](https://php-fpm.org/download).
* [**PHP**](https://www.php.net/downloads.php).
* [**BIND**](https://www.isc.org/download/).
* [**Certbot**](https://certbot.eff.org/instructions?ws=nginx\&os=centosrhel7).
* [**Telegram**](https://telegram.org/apps).

## Installation

### Konfigurasi Nginx & SSL

Konfigurasi Web Server dan juga SSL, untuk instalasi Certbot silakan mengikuti tautan berikut:

{% code overflow="wrap" %}

```url
https://certbot.eff.org/lets-encrypt/centosrhel7-nginx
```

{% endcode %}

### Cloning Source Code PHP

Kemudian lakukan cloning PHP source code berikut ke root directory website atau domain (Misal: **`/var/www/[DOMAIN]/public_html`**):

{% code overflow="wrap" lineNumbers="true" %}

```bash
cd /var/www/[DOMAIN]/public_html
git clone https://github.com/madfxr/WhoisXBot.git
```

{% endcode %}

## Configuration

### Membuat Bot Baru di BotFather

Setelah itu lakukan chat ke [**@BotFather**](https://t.me/BotFather) di Telegram dan buat bot baru (Misal: **yourBotName**).

### Generate HTTP API Token

Kemudian buat HTTP API Token baru di [**@BotFather**](https://t.me/BotFather) (Misal: **`613961047:AZFWy0k603kLssujSIkKacmKuxxxTnq8Wl4`**).

### Integrasi Telegram Bot

Ubah file **`index.php`**&#x64;an sesuaikan **`<authorization_token>`**&#x64;engan menggunakan HTTP API Token yang sebelumnya kita dapat dari [**@BotFather**](https://t.me/BotFather) di Telegram (Misal: **`613961047:AZFWy0k603kLssujSIkKacmKuxxxTnq8Wl4`**).

### Upload File PHP

Setelah itu upload file **`index.php`** ke Web Server yang sudah ter-install sertifikat SSL sebelumnya.

### Verifikasi Webhook Telegram Bot

Akses URL berikut ini melalui web browser untuk mengeset webhook **`https://api.telegram.org/bot<authorization_token>/setWebhook?url=https://[DOMAIN]/index.php`**:&#x20;

{% code overflow="wrap" %}

```url
https://api.telegram.org/bot613961047:AZFWy0k603kLssujSIkKacmKuxxxTnq8Wl4/setWebhook?url=https://[DOMAIN]/index.php
```

{% endcode %}

### Membuat Command Bot

Terakhir chat ke [**@BotFather**](https://t.me/BotFather) di Telegram dan edit **`@BOT_NAME`** command:

{% code overflow="wrap" %}

```markdown
whois - Client for the whois directory service
```

{% endcode %}

> **Catatan:**
>
> * WhoisXBot hanya dicoba di sistem operasi CentOS 7 x86\_64 saja.
> * Jika menggunakan sistem operasi lain, jangan lupa untuk melakukan perubahan pada source code PHP yang sudah ada.

Demikian sedikit pengetahuan dan pengalaman yang dapat saya bagikan, semoga apa yang telah saya sampaikan dapat bermanfaat bagi kita semua.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://blog.madfxr.my.id/documentation/categories/cloud-computing/whois-lookup-utility-untuk-tld-gtld-cctld-dan-mtld-dengan-menggunakan-telegram-bot.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
