leo.blog();

QOTD Protocol

Quote of the Day is a simple protocol that is used to deliver daily quotes. Although its usage is almost nonexistent these days, there are still a few public servers. The protocol is defined by RFC865. According to the RFC, a QOTD server is run on port 17 for TCP and UDP connections. It is an excellent protocol to learn the socket API and to write your first server.

Protocol details

The RFC is quite short, actually it is just half a page. Therefore, it is highly recommended to read it. But the protocol details are also written below in an easy-to-understand manner.

Recommendations

The RFC recommends that;

Since the protocol is only used to send quotes to terminals, these aren’t hard requirements. But a server should still follow these recommendations in order to be compatible with the other servers and clients.

Despite the name being Quote of the Day, a server does not have to serve daily quotes. It can change the quote at any interval or send random quotes at each connection.

TCP Connections

When a QOTD server gets a connection, it sends a quote and closes the connection, discarding any received data. Basically, a server should do the following

  1. Listen to connections on port 17.
  2. Accept a connection.
  3. Choose a random quote.
  4. Send the quote to the client.
  5. Close the connection.

UDP Connections

A UDP server is a bit different from a TCP one. Since UDP has no concept of connections, a server just sends the quote after getting a UDP datagram.

Public QOTD Servers

Despite being almost extinct, the following servers have been reported to work.

Server AddressTCP PortUDP Port
um.imstillthinking.net17N/A
djxmmx.net1717
wreeper.top17N/A

These servers used to work, but they don’t anymore. I’m keeping them here to occasionally check if they are back online, and put them back on the list if they are.

Server AddressTCP PortUDP Port
alpha.mike-r.com1717
cygnus-x.net1717

Code examples

Since the protocol is very simple and completely one-way, it is easy to write your own QOTD server and QOTD client.

QOTD server in Python

Below is the code for a simple, single-threaded QOTD server written in Python. On each connection, it picks a random quote from the quotes list and sends it to the client. It should be an easy exercise to read the quotes from a file or a database.

import socket
import random

quotes = [
    "Never do today what you can do tomorrow",
    "Nobody lies on the internet",
    "The cake is a lie"
]

server = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
server.bind(("0.0.0.0", 17)) # Bind to port 17
server.listen(5)

while True:
    sock, addr = server.accept()
    quote = random.choice(quotes)
    sock.send(quote.encode() + b"\n")
    sock.close()

QOTD client in Python

import socket

addr = ("example.com", 17) # Change server address

conn = socket.create_connection(addr)
quote = conn.recv(4096) # Read up to 4096 bytes

print(quote.decode("utf-8"))

Leave a Comment

Comments

Vyshnav on 2025-11-21 11:19:23

Spam probability: 0.08%

Awesome to learn about this and the quotes still come by!

Ryan (imstillthinking.net) on 2024-12-23 07:11:04

Spam probability: 2.35%

I created my own server! I made a page on my site about how to access it: https://imstillthinking.net/projects/qotd-server/ um.imstillthinking.net:17 Feel free to add it here!

Ryan (imstillthinking.net) on 2024-12-16 06:37:20

Spam probability: 0.84%

It looks like wreeper.top is unfortunately down. This makes djxmmx.net possibly the only public one known on the internet right now that is still working. I may look into setting up my own...

Guest on 2024-05-27 10:05:16

Spam probability: 1.08%

hi

admin on 2024-01-24 08:52:35

Spam probability: 0.01%

Hey wreeper, Thanks for keeping this alive and setting up another server, I now added yours to the list. While I was adding your new server, I also checked the existing ones I had there, and it seems two of them are now gone. :( Perhaps I should set up my own QOTD server as well, just to have some more variety in the list.

someone on 2024-01-24 05:50:37

Spam probability: 0.24%

Hi, i started running a random quote server (although for my own quotes). The DNS is wreeper.top

Will on 2023-01-25 10:37:09

Spam probability: 0.04%

Running the server on macOS with python3 (version 3.10.8 used in my testing) gives the error: Traceback (most recent call last): File "/Users/gamble05/qotd.py", line 17, in <module> sock.send(f"{quote}\n") TypeError: a bytes-like object is required, not 'str' when making a connection using `nc localhost 17` This can be fixed by replacing: quote = random.choice(quotes) sock.send(f"{quote}\n") with: quote = random.choice(quotes)+"\n" sock.send(bytes(quote, 'utf-8'))

Guest on 2022-07-27 07:48:21

Spam probability: 10.87%

I'm sorry whats this website for? djxmmx.net

Guest on 2022-06-20 04:47:25

Spam probability: 5.10%

djxmmx.net still works :)

Guest on 2022-01-07 03:04:38

Spam probability: 0.64%

Hello from 2021

admin on 2019-05-31 08:29:24

Spam probability: 1.11%

The client can be anything that connects to a socket and reads data from it. Netcat is a great example. nc IP 17

David on 2019-05-30 11:56:01

Spam probability: 0.98%

Where is the client?

Bart on 2019-02-08 10:13:53

Spam probability: 0.16%

Nice protocol

Simon on 2018-09-13 09:50:20

Spam probability: 0.63%

Thank you!