Ruby WHOIS server
Find a file
Martin dcd927e46d
Merge pull request #176 from internetee/snyk-fix-c23028af424108bce76cb8020f5ddcf0
[Snyk] Security upgrade ruby from 3.4.2-bullseye to 3.4.5-bullseye
2025-08-28 10:57:46 +03:00
.github/workflows Update actions/checkout action to v5 2025-08-25 10:54:16 +00:00
app Fixed codeclimate issues 2025-03-07 16:17:27 +02:00
charts Build, test and deploy on PR to main (#68) 2021-04-14 15:52:33 +03:00
config qlty 2025-07-17 14:28:55 +03:00
db Create Rake database tasks (#67) 2021-02-05 11:19:18 +02:00
lib Refactor: extract domain regex to shared module and fix test 2025-07-24 13:35:36 +03:00
log configurable binding via dotenv 2017-06-09 15:02:43 +03:00
test Refactor: extract domain regex to shared module and fix test 2025-07-24 13:35:36 +03:00
tmp/pids configurable binding via dotenv 2017-06-09 15:02:43 +03:00
.dockerignore Updated dockerfiles 2025-04-14 16:12:49 +03:00
.gitignore Build, test and deploy on PR to main (#68) 2021-04-14 15:52:33 +03:00
.ruby-gemset added ruby versions 2015-01-14 12:21:25 +02:00
.ruby-version Update dependency ruby to v3.4.4 2025-07-29 20:31:20 +00:00
CHANGELOG.md Update CHANGELOG.md 2025-08-28 10:57:18 +03:00
Dockerfile fix: Dockerfile to reduce vulnerabilities 2025-07-18 06:22:41 +00:00
Dockerfile.dev Updated dockerfiles 2025-04-14 16:12:49 +03:00
Dockerfile.generic Build and deploy on pr (#114) 2022-01-24 15:41:38 +02:00
env-example configurable binding via dotenv 2017-06-09 15:02:43 +03:00
Gemfile Merge pull request #186 from internetee/snyk-fix-e49edf19df18debf43a943a548bd1239 2025-08-25 13:53:45 +03:00
Gemfile.lock Merge pull request #186 from internetee/snyk-fix-e49edf19df18debf43a943a548bd1239 2025-08-25 13:53:45 +03:00
LICENSE Update LICENSE 2015-10-27 14:50:42 +02:00
Rakefile qlty 2025-07-17 14:28:55 +03:00
README.md Updated redame 2025-03-10 10:24:14 +02:00
renovate.json Refactored and updated 2025-03-06 16:03:21 +02:00
whois.rb Refactored and updated 2025-03-06 16:03:21 +02:00

Whois server

Whois server build on top of ruby EventMachine.

Demo Installation

Before demo install, please ensure you have rbenv and postgres installed.

git clone https://github.com/internetee/whois.git
cd whois
bundle
cp config/database-example.yml config/database.yml # and edit it
cp env-example .env # and edit it according to your needs

# create postgres database, example:
# create database whois owner whois encoding 'UTF-8' LC_COLLATE 'et_EE.utf8' LC_CTYPE 'et_EE.utf8' template template0;

ruby whois.rb run # or start for daemon, other commands: status start stop run --help
sudo apt-get install whois
whois hello.ee -h localhost -p 1043 # by default whois run on port 43

You should receive

Hello from whois server!

If you have any issues you can try run whois server on front:

ruby whois.rb stop   # stops running whois
ruby whois.rb run    # runs whois server in terminal for debug
ruby whois.rb --help # for other commands

Docker Installation

To run the WHOIS server using Docker:

  1. Clone the repository:

    git clone https://github.com/internetee/whois.git
    cd whois
    
  2. Configure the application:

    cp config/database-example.yml config/database.yml
    cp env-example .env
    

    Edit these files according to your environment.

  3. Build the Docker image:

    docker build -t whois-server .
    
  4. Run the container:

    docker run -d -p 43:43 --name whois-server \
      --env-file .env \
      -v $(pwd)/config/database.yml:/opt/webapps/app/config/database.yml \
      whois-server
    
  5. Test the WHOIS server:

    whois hello.ee -h localhost -p 43
    

Production installation

Before production installation, please ensure you have rbenv and postgres installed.

At your local machine:

git clone https://github.com/internetee/whois.git
cd whois
bundle
gem install mina # or any other deploy tool
cp config/deploy-example.rb config/deploy.rb # and edit it
mina pr setup

Add init script and edit it:

sudo cp config/whois-init-example /etc/init.d/whois
sudo chmod +x /etc/init.d/whois

Start server

sudo /etc/init.d/whois start

Additional notes

Request logs are going to syslog, however all daemon related errors are going to log directory because daemon lib currently not supporting syslog, probably in future it will happen.