• Stars
    star
    255
  • Rank 158,820 (Top 4 %)
  • Language
    JavaScript
  • License
    Apache License 2.0
  • Created about 5 years ago
  • Updated 10 months ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

1.1.1.1 works from a Discord server, thanks to the 1.1.1.1 bot. Invite the bot to your Discord server to start using DNS over Discord.

DNS over Discord

A 1.1.1.1 DNS resolver built for Discord

This documentation is also available on Cloudflare's developer documentation site


1.1.1.1 works from a Discord server, thanks to the 1.1.1.1 bot. Invite the bot to your Discord server to start using DNS over Discord.

Perform DNS lookups

Once the bot is in your server, type /dig to start performing DNS lookups. This will provide a native interface within Discord that allows you to specify the domain to lookup, an optional DNS record type and an optional flag for a short result.

If only a domain is given for the command, the bot will default to looking for A DNS records, and will return the full format result, not the short form.

Example:

/dig domain: cloudflare.com

Supported record types

Discord has a limit of 25 options in slash commands, so DNS over Discord offers the 25 most common DNS record types to choose from.

Supported DNS record types
  • A
  • AAAA
  • CAA
  • CDNSKEY
  • CDS
  • CERT
  • CNAME
  • DNSKEY
  • DS
  • HINFO
  • HTTPS
  • LOC
  • MX
  • NAPTR
  • NS
  • PTR
  • SMIMEA
  • SOA
  • SPF
  • SRV
  • SSHFP
  • SVCB
  • TLSA
  • TXT
  • URI

To query other DNS record types, or multiple record types at once, use the /multi-dig command.

Short form response

DNS over Discord has an optional flag in the /dig command that allows the user to request a response in the short form.

When you request a response in the short form, the name and TTL columns will be excluded. The command only returns the data column without formatting, similar to the equivalent dig command-line interface response.

Example:

/dig domain: cloudflare.com type: AAAA records short: True

Disable DNSSEC checking

You can disable DNSSEC checking in the dig command by passing cdflag as true. This will get the records even if validation fails.

Example:

/dig domain: cloudflare.com type: AAAA records cdflag: True

Refreshing existing results

You can refresh the DNS lookup results by clicking the Refresh button. Clicking it will trigger the bot to re-request the DNS query in the message, and update the results in the message. Any user can click this button.

The refresh button is available on all responses to the /dig command, including those that resulted in an error, such as an unknown domain or no records found.

Refreshing dig domain: cloudflare.com

Changing DNS provider

By default, the DNS over Discord bot uses Cloudflare's 1.1.1.1 DNS service. You can run the DNS lookup with alternate DNS providers by selecting the dropdown below the result. This shows you a list of available providers. Selecting a new provider updates the results in the message. Any user can change the DNS provider.

Supported DNS providers

Changing DNS provider (1.1.1.1 -> 8.8.8.8) for dig domain: cloudflare.com

multi-dig command

If you want to look up multiple DNS record types at once, use the /multi-dig command. This allows you to specify any supported DNS record type, and multiple types separated by a space.

Example:

/multi-dig domain: cloudflare.com types: A AAAA

Supported record types

When providing DNS record types for the /multi-dig command, Discord will not prompt you with options. You have to provide a space-separated list of valid DNS record types to lookup, as any invalid options will be silently dropped. A records will be used as the default if no valid types are given.

DNS record types supported and considered valid by the bot

Use a * (asterisk) in place of a record type to get DNS results for all supported types.

  • A
  • AAAA
  • AFSDB
  • APL
  • CAA
  • CDNSKEY
  • CDS
  • CERT
  • CNAME
  • CSYNC
  • DHCID
  • DLV
  • DNAME
  • DNSKEY
  • DS
  • EUI48
  • EUI64
  • HINFO
  • HIP
  • HTTPS
  • IPSECKEY
  • KEY
  • KX
  • LOC
  • MX
  • NAPTR
  • NS
  • NSEC
  • NSEC3
  • NSEC3PARAM
  • OPENPGPKEY
  • PTR
  • RP
  • SMIMEA
  • SOA
  • SPF
  • SRV
  • SSHFP
  • SVCB
  • TA
  • TKEY
  • TLSA
  • TXT
  • URI
  • ZONEMD

Short form response

Like the main /dig command, the /multi-dig command also supports the optional short flag after the types have been specified in the slash command.

Example:

/multi-dig domain: cloudflare.com types: CDS CDNSKEY short: True

Disable DNSSEC checking

Exactly like dig command, you can disable dns checking by passing cdflag as true. This will get the records even if validation fails.

Example:

/multi-dig domain: cloudflare.com type: AAAA records cdflag: True

Refreshing existing results

The /multi-dig command also provides a refresh button below each set of DNS results requested (or after each block of 10 DNS record types, if you requested more than 10).

As with the /dig command, any user can press the refresh button to refresh the displayed DNS results, including for DNS queries that had previously failed.

Refreshing multi-dig domain: cloudflare.com types: A AAAA

Changing DNS provider

Like the /dig command, you can change the DNS provider when using the /multi-dig command. The menu appears after each set of DNS results (or after each block of results if more than 10 record types are requested).

This menu can be used be any user to change the DNS provider used for the lookup.

Supported DNS providers

Changing DNS provider (1.1.1.1 -> 8.8.8.8) for multi-dig domain: cloudflare.com types: A AAAA

whois command

The /whois command allows you to perform a RDAP/WHOIS lookup right in Discord for a given domain, IP or ASN.

Examples:

/whois query: cloudflare.com
/whois query: 104.16.132.229
/whois query: 2606:4700::6810:84e5
/whois query: 13335

Other commands

The bot also has a set of helper commands available to get more information about the bot and quick links.

help command

The /help command provides in-Discord documentation about all the commands available in the 1.1.1.1 DNS over Discord bot.

Example:

/help

privacy command

The /privacy command displays the Privacy Policy notice for using the 1.1.1.1 DNS over Discord bot. You can also refer to the Privacy Policy page to access it.

Example:

/privacy

terms command

The /terms command displays the Terms of Service notice for using the 1.1.1.1 DNS over Discord bot. You can also refer to the Terms of Service page to access it.

Example:

/terms

github command

The DNS over Discord bot is open-source, and the /github command provides a quick link to access the GitHub repository. The GitHub repository can be accessed at https://github.com/MattIPv4/DNS-over-Discord/.

Example:

/github

invite command

The /invite command provides the user with a quick link to invite the 1.1.1.1 DNS over Discord bot to another Discord server. The bot can be invited at any time with https://dns-over-discord.v4.wtf/invite.

/invite

Development

  1. Create your test Discord application at https://discord.com/developers/applications (this does not need a bot account, just the application).
  2. Create your development.env file. Copy development.env.sample and fill out the information from your Discord application, plus the ID of your test server/guild.
  3. Authenticate with Wrangler by running wrangler login.
  4. Update wrangler.toml for your account.
    • Use wrangler whoami to get your account ID, update the value in wrangler.toml to match.
    • Use wrangler kv:namespace create "CACHE" to create the KV namespace, update the id and preview_id in wrangler.toml to match.
  5. Develop with the worker by running npm run dev.
  6. (Optional) Start an HTTP tunnel to your local development server by running npm run tunnel, using cloudflared.

Deployments

wrangler.toml and this repository is currently designed for a staging deployment and a production deployment.

Ensure that you've created and configured staging.env and production.env appropriately (staging.env has a test server/guild by default, but this can be removed to stage global commands).

Ensure that the staging/production environments in wrangler.toml have been updated with your zone IDs and routes for the workers.

Ensure that the KV namespaces are created for staging/production environments and are configured in wrangler.toml. Use wrangler kv:namespace create "CACHE" --env <staging/production>.

To deploy from local, run npm run publish:staging to deploy to staging, and npm run publish:production to deploy to the production environment.

To deploy using GitHub, run make deploy-staging to force push and deploy to staging, and make deploy-production to force push and deploy to the production environment.

Live logs for both environments can be accessed with npm run logs:staging and npm run logs:production as needed.

Contributing

Contributions are always welcome to this project!
Take a look at any existing issues on this repository for starting places to help contribute towards, or simply create your own new contribution to the project.

Please make sure to follow the existing standards within the project such as code styles, naming conventions and commenting/documentation.

When you are ready, simply create a pull request for your contribution and I will review it whenever I can!

Donating

You can also help me and the project out by sponsoring me through GitHub Sponsors (preferred), contributing through a donation on PayPal or by supporting me monthly on my Patreon page.

GitHub Sponsors Patreon PayPal

Discussion, Support and Issues

Need support with this project, have found an issue or want to chat with others about contributing to the project?

Please check the project's issues page first for support & bugs!

Not found what you need here?

  • If you have an issue, please create a GitHub issue here to report the situation, include as much detail as you can!
  • or, You can join our Slack workspace to discuss any issue, to get support for the project or to chat with contributors and myself:
Slack

More Repositories

1

PyDMXControl

A Python 3 module to control DMX using OpenDMX or uDMX - Featuring fixture profiles, built-in effects and a web control panel.
Python
97
star
2

divoom-control

A little script/CLI for controlling Divoom devices (Pixoo etc.)
JavaScript
78
star
3

pogchamp

Your new PogChamp is... View the new Twitch PogChamp and the history of the PogChamp of the Day at pogchamp.today
JavaScript
29
star
4

macOSNotifJS

A simple Javascript plugin to create simulated macOS notifications on your website.
JavaScript
21
star
5

hacktoberfest-data

Generating stats from the raw Hacktoberfest application data.
JavaScript
19
star
6

Personal-Site

My humble personal homepage, made with a tiny bit but not much care.
SCSS
18
star
7

status-codes

A maintained JSON collection of HTTP status codes
HTML
16
star
8

tweets-to-discord

Mirroring Tweets from a Twitter account to a Discord channel via scheduled Cloudflare Workers
JavaScript
15
star
9

do_username

A DigitalOcean-community-themed username generator. Implemented in Ruby, JavaScript and Rust.
JavaScript
14
star
10

monitors

Uptime monitoring (or really any monitoring that can throw an error) through Node.js & GitHub Actions.
JavaScript
12
star
11

web-whois

Perform RDAP/WHOIS lookups over HTTP
JavaScript
12
star
12

spotify-smart-emoji

Automated creation of mega-playlists in Spotify based on emoji
JavaScript
10
star
13

twitch-alerter

JavaScript
9
star
14

workers-sentry

Some wrappers for using Sentry in Workers
JavaScript
9
star
15

CV

An elegant and expandable CV design made with SASS, HTML and love.
HTML
9
star
16

template

The template README (and other files) for my GitHub repositories
8
star
17

pet-panda

A simple virtual pet panda to embed on any webpage
JavaScript
8
star
18

static-url-shortener

Uni project -- URL shortener but static with GitHub Pages + GitHub Actions
JavaScript
7
star
19

gitmail

Find a GitHub user's email.
JavaScript
7
star
20

workers-discord

Some wrappers for Discord applications in Workers
TypeScript
6
star
21

Reddit-Bots

All the Reddit bots I maintain and run - sans configs.
Python
6
star
22

tree-parse

A super simple package to parse the string output of the unix tree command into an object.
JavaScript
5
star
23

RSS-Merger

A PHP tool to merge multiple RSS streams into one output.
PHP
4
star
24

cdnjs-add-cli

CLI tool for adding new package configurations to cdnjs
JavaScript
4
star
25

virtual-cam

JavaScript
4
star
26

cells

JavaScript
4
star
27

s.v4.wtf

Static URL shortener for s.v4.wtf
JavaScript
4
star
28

stream

Livestreaming stuff
JavaScript
4
star
29

workflow-cron

Scheduling GitHub Actions workflows with Cloudflare Workers cron triggers
JavaScript
4
star
30

battlesnake

This is my bad attempt at implementing my own Battlesnake.
JavaScript
4
star
31

digitalocean-art

JavaScript
3
star
32

object-nested-size

JavaScript
3
star
33

Whack-a-Mole

A simple but expandable Whack a Mole game written with PyGame.
Python
3
star
34

node-grpc-server

Demo gRPC server in Node.js with a partial server reflection implementation and a demo greeter service.
JavaScript
3
star
35

jingle-jam-total

Saying hello to the Tiltify API to get the total raised for Jingle Jam 2020
JavaScript
3
star
36

redirect-botz

Redirecting botz.mattcowley.co.uk to restarter.mattcowley.co.uk
SCSS
3
star
37

memory-tar-create

Create gzipped tar archives in memory and download them as files or base64 strings.
JavaScript
3
star
38

webstorm-jsdoc-issues

Just documenting some issues with Webstorm JSDoc support
JavaScript
3
star
39

redirect

A simple redirect page for GitHub Pages designed to work with a CNAME. Hacktoberfest '19 themed.
CSS
3
star
40

github-first-contributions

A little script that scrapes GitHub hovercards on PRs to see if they're first contributions.
JavaScript
3
star
41

jsdoc-method-type

jsdoc/jsdoc#1986
JavaScript
3
star
42

m.v4.wtf

A little MOTD API thing
3
star
43

files-diff

Highlight changes and additions across a set of files in an object.
JavaScript
3
star
44

Discord-Status

Discord Status - A reddit bot that will post Discord status updates
Python
3
star
45

LMC-Dump

A dump of LMC scripts
2
star
46

redirect-bluesky

Redirecting bluesky.mattcowley.co.uk to bsky.app/profile/v4.wtf
SCSS
2
star
47

open-slay

JavaScript
2
star
48

Room-Tablet

JavaScript
2
star
49

redirect-twitch

Redirecting twitch.mattcowley.co.uk to twitch.tv/MattIPv4
CSS
2
star
50

redirect-twitter

Redirecting twitter.mattcowley.co.uk to twitter.com/MattIPv4
CSS
2
star
51

dabbitpri.me

Domain for Sale
HTML
2
star
52

redirect-paypal

Redirecting paypal.mattcowley.co.uk to paypal.me/MattIPv4Cowley
CSS
2
star
53

Microbit-Bot-Monitor

Python
2
star
54

redirect-amazon

Redirecting amazon.mattcowley.co.uk to amzn.eu/hrEICTk
SCSS
2
star
55

redirect-patreon

Redirecting patreon.mattcowley.co.uk to patreon.com/IPv4
CSS
2
star
56

redirect-linkedin

Redirecting linkedin.mattcowley.co.uk to linkedin.com/in/matt-ipv4-cowley
CSS
2
star
57

bfd.py

A simple API wrapper for botsfordiscord.com written in Python
Python
2
star
58

redirect-cv

Redirecting cv.mattcowley.co.uk to mattcowley.co.uk/cv
SCSS
2
star
59

redirect-sponsors

Redirecting sponsors.mattcowley.co.uk to github.com/sponsors/MattIPv4
CSS
2
star
60

twitch-chatter

Twitch chat (with Twitch + BTTV + FFZ emotes) as an HTML output, or something
JavaScript
2
star
61

redirect-slack

Redirecting slack.mattcowley.co.uk to join.slack.com/t/mattipv4/shared_invite/...
SCSS
2
star
62

Webcal-Fixer

A webcal fixer to convert 12am->11:59pm events to all day events.
PHP
2
star
63

A-Level-Comp-Sci-Project

Public 'cause it is too big to email - No PRs please
Python
2
star
64

redirect-discord

Redirecting discord.mattcowley.co.uk to discord.gg/sufxTxZ
CSS
2
star
65

redirect-github

Redirecting github.mattcowley.co.uk to github.com/MattIPv4
CSS
2
star
66

Page-Load-Logger

A single Python script to log page load speeds to an SQLite database
Python
2
star
67

timezones

A little tool to display the time/date in multiple timezones
JavaScript
2
star
68

metalist.py

A simple API wrapper to post Discord bot stats to all known bot lists using metalist.xyz data.
Python
2
star
69

BIO18

My attempt, in Python, at the questions set out in the British Informatics Olympiad 2018.
Python
2
star
70

home-automation

Scripts for my home automation RaspPi
Python
1
star
71

Py-Speedtest

A speedtesting and logging script written in Python and PHP.
PHP
1
star
72

youtube-chatter

Based on https://github.com/MattIPv4/twitch-chatter, but for YouTube
JavaScript
1
star
73

status-screamer

A little Python bot that continually screams in Discord to let you know it's alive.
Python
1
star
74

Dijkstrastar

A Python, PyGame simulation of Dijkstra and A*, running at the same time.
Python
1
star
75

shop.cdnjs.dev

HTML
1
star
76

cdnjs-add

PHP
1
star
77

xyzxyzxyzxyzxyzxyzxyzxyz.xyz

The simple PHP to run my xyzxyzxyzxyzxyzxyzxyzxyz.xyz site
PHP
1
star
78

HTML-CSS-JS-In-One

Hmmmm
HTML
1
star
79

audio-mono-fix

Fixing left-channel only inputs, duplicating to all channels.
JavaScript
1
star
80

.github

1
star