Commit Graph

28 Commits

Author SHA1 Message Date
Brian Cunnie
14d1aa9fe7 PTR domain is now configurable, defaults to nip.io
Default PTR record domain has changed from "sslip.io" to "nip.io".
For example, `dig -x 127.0.0.1 @ns.nip.io` previously returned
`127-0-0-1.sslip.io.`, now returns `127-0-0-1.nip.io.`

Previously, the PTR domain was hard-coded to `sslip.io.`, but this
commit introduces two changes:

- the default PTR domain is now `nip.io.`. Hey, it's shorter.
- the PTR domain can now be set with the `-ptr-domain` flag, e.g. `go
  run main.go -ptr-domain=xip.example.com` and then querying `dig -x
  169.254.169.254` would return `169-254-169-254.xip.example.com.`

Notes:

- Our new flag, `-ptr-domain`, follows the kebab-case convention of
  Golang flags, but this is inconsistent with our previous camelCase
  convention, e.g. `-blocklistURL`. We didn't know any better, and it's
  too late to change existing flags.
- removed two comment-out `panic()` whose purpose has long since been
  forgotten
- I don't feel bad about changing the default behavior because hardly
  anyone uses PTR lookups. Out of 12,773,617,290 queries, only 1564 were
  PTR records (0.000012%)!
- In that vein, I acknowledge that this is a feature that no one's
  clamoring for, no one will use, but it's important to me for reasons
  that I don't fully understand.
2025-07-29 06:56:02 -07:00
Brian Cunnie
93d7d7298a Bump serial 20250615 → 20250723
Brendan's sixtieth. Happy birthday.
2025-07-22 20:48:24 -07:00
Brian Cunnie
c7d8e598bd Revert "TXT record attests ownership for the Public Suffix List"
This reverts commit dea655a990.

The Public Suffix List (PSL) denied our pull request to add sslip.io to
their list: <https://github.com/publicsuffix/list/pull/2206>

So there's no reason to keep their TXT record around; it only adds to
the clutter.
2025-07-20 06:38:01 -07:00
Brian Cunnie
8b189178ad nip.io has same TXT record behaviors
I want to promote nip.io to the same status as sslip.io, same features,
same special TXT records.

This will allow me to write automated health checks for both nip.io and
sslip.io instead of only sslip.io

Side note: I prefer the shorter "nip.io". I went with "sslip.io" when
Sam Stephenson suggested it even though I thought that "tlsip.io" would
be more apropos (TLS had long since replaced SSL), and within a month
the domain name didn't make sense because Comodo had revoked our
certificate.

- ip.nip.io returns the IP address TXT record
- version.status.nip.io returns the version information in a TXT record
- metrics.status.nip.io returns the metrics information in a TXT record

The Sender Policy Framework (SPF) TXT records remain different for both
domains.

sslip.io Public Suffix List (PSL) TXT remains & was not implemented for
nip.io. The PSL has denied our PR to add sslip.io to the list. That TXT
record will be removed in a future commit.

I backfilled unit tests for {version,metrics].status.{nip,sslip}.io.

Drive-by: A `for` loop was rewritten as a `copy()` at the behest of the
linter.
2025-07-20 05:58:09 -07:00
Brian Cunnie
d5d02f5999 Resolve hexadecimal notation for IPv6 addresses
e.g. `00000000000000000000000000000001.nip.io` → ::1

This is to bring parity with IPv4's hexadecimal notation, though IPv6's
hexadecimal notation is so clunky that I doubt it'll ever be used.

- The hexadecimal-notated IPv6 must be exactly 32 hexadecimal
  characters, no separators.
- Any hexadecimal notation _must_ be bookended by dots or by the
  beginning or end of the string
  (www.0000000000000000000000000000001.sslip.io or
  00000000000000000000000000000001.sslip.io). No dashes.
- If a normal IP notation and a hex notation are in the same hostname,
  then the normal IP notation takes precedence. This preserves existing
  behavior for sslip.io users, e.g.
  (00000000000000000000000000000001.2600--.nip.io resolves to 2600::,
  not ::1)
2025-06-22 14:09:30 -07:00
Brian Cunnie
08ca8e4e85 Placate VS Code's linter
This commit is cosmetic changes to the code (no change in
functionality). We must mollify the linter, for to do otherwise would
risk wrath.
2025-06-21 17:15:15 -07:00
Brian Cunnie
03eb55555d Resolve hexadecimal notation for IPv4 addresses
e.g. `7f000001.sslip.io` → 127.0.0.1

This came about as a result of the nip.io migration to sslip.io servers:
nip.io supported hexadecimal notation; sslip.io didn't. Several nip.io
users were blindsided by the feature's lack, and raised an issue.

- The hexadecimal-notated IPv4 must be exactly 8 hexadecimal characters,
  no separators.
- Any hexadecimal notation _must_ be bookended by dots or by the
  beginning or end of the string (www.0a09091e.sslip.io or
  0a09091e.sslip.io). No dashes.
- If a normal IP notation and a hex notation are in the same hostname,
  then the normal IP notation takes precedence. This preserves existing
  behavior for sslip.io users, e.g. (0a09091e.127-0-0-1.sslip.io
  resolves to 127.0.0.1, not 10.9.9.30)

[#92]
2025-06-21 13:10:17 -07:00
Brian Cunnie
9efb68a672 🐞 nip.io has correct DKIM 2025-06-15 16:47:17 -07:00
Brian Cunnie
7a82e55698 nip.io: accommodate email and webservers
- Proton insists on have a TXT record before adding that domain, and we
  comply with "protonmail-verification=19b0837cc4d9daa1f49980071da231b00e90b313"
- We add A & AAAA records for nip.io, identical to sslip.io's.
- We add convenience records for ns1.nip.io and ns2.nip.io to eliminate
  the dreaded automated message "dig: couldn't get address for
  'ns1.nip.io': not found"
2025-06-15 15:47:08 -07:00
Brian Cunnie
854fe40018 Bump serial 20250420 → 20250615
Happy Father's Day.
2025-06-15 15:25:57 -07:00
Brian Cunnie
6d03384268 Bump serial 20250101 → 20250420
Heck, if I can't do New Year's Day, then let's celebrate cannabis
2025-04-26 19:01:34 -07:00
Brian Cunnie
7d6b724cbe Remove traces of nameservers ns-aws, ns-azure
- ns-aws & ns-azure have been replaced by ns-hetzner & ns-ovh
- ns-azure has been completely destroyed (`terraform apply -destroy`);
  the elastic IP has been released, so there's no hope of bringing it
  back.
- ns-aws has been renamed to "blocked.sslip.io". It no longer answers
  DNS queries, but lives on as the website we point "blocked" queries to
  that warns about phishing.
- Some of the Markdown files' changes were mere reformatting changes
2025-01-04 11:28:40 -08:00
Brian Cunnie
70c0b3ca74 Update SOA to 01/01
New year deserves new SOA
2025-01-04 08:10:04 -08:00
Brian Cunnie
a17e9cc8c0 🐞 Make metrics more readable (no Unicode)
When using dig to determine the metrics of my servers, e.g. "dig txt
metrics.status.sslip.io @ns-ovh.sslip.io +short", one record looks
particularly heinous:

```
"Answer \226\137\165 1: 67974722 (651.9/s)"
```

It's supposed to look like this:

```
"Answer ≥ 1: 67974722 (651.9/s)"
```

`dig` doesn't handle Unicode well. So I'm replacing "Answer ≥ 1" with
"Answer > 0". No Unicode.

It was a worthy effort, but ultimately failed.
2024-12-04 18:16:17 -08:00
Brian Cunnie
0fc3c81641 Replace ambiguous metric, "Answered Queries"
I've always been uncomfortable with the metric "Answered Queries" — it
implies that we don't answer all the queries. But we do answer all the
queries!

What the metric meant is "the number of DNS responses that we send that
have one or more records in the ANSWER section".

The new metric is "Answer ≥ 1". Not great, but better than before.
2024-11-19 09:25:10 -08:00
Brian Cunnie
30d51c3014 Update SOA to 11/15
Jon Penn's birthday; probably the most life-changing birthday party I've
ever been to.
2024-11-16 16:09:43 -08:00
Brian Cunnie
ef731f067d Update SOA to 11/5
The late, great Tom Casey's birthday
2024-11-04 18:05:37 -08:00
Brian Cunnie
34318bbb43 Retire DNS server, ns-aws.sslip.io
The torrent of traffic I'm receiving has caused my AWS bill to spike
from $9 to $148, all of the increase due to bandwidth charges.

I'm still maintaining ns-aws; the VM still continue to run, and continue
to serve web traffic, and maintain its hostname and IP addresses;
however, it will no longer be in the list of NS records for sslip.io.

There are much less expensive hosting providers. OVH is my current
favorite.
2024-11-04 17:56:03 -08:00
Brian Cunnie
1f7a54db73 Revert "Introduce new flag, -max_queries_per_sec"
Rather than bloating the code with yet another flag, one that only I
would use, and in only one specific case (ns-aws.sslip.io), it would be
better to simply take ns-aws.sslip.io out of the NS list.
2024-11-04 07:16:52 -08:00
Brian Cunnie
9c8712578d Introduce new flag, -max_queries_per_sec
I'm being gouged by bandwidth costs by AWS. Last month's bill was $148,
and all but $9 was about bandwidth.

My bandwidth has been inexplicably climbing since February:

Billing
Month   Total GB % increase

2024/2		  37.119
2024/3		  52.953	42.66%
2024/4		  58.745	10.94%
2024/5		  69.307	17.98%
2024/6		 173.371	150.15%
2024/7		 334.064	92.69%
2024/8		 539.343	61.45%
2024/9		 568.745	5.45%
2024/10	1365.305	140.06%

The new flag will allow me to throttle the AWS bandwidth to ~287 queries
/ second, which, according to my calculations, will max out the free
100 GB bandwidth without dipping into the for-pay bandwidth.
2024-11-03 17:35:46 -08:00
Brian Cunnie
dea655a990 TXT record attests ownership for the Public Suffix List
We want to place sslip.io on the Public Suffix List so we don't need to
pester Let's Encrypt for rate limit increases.

According to https://publicsuffix.org/submit/:

> owners of privately-registered domains who themselves issue subdomains
to mutually-untrusting parties may wish to be added to the PRIVATE
section of the list.

References:

- https://publicsuffix.org/
- https://github.com/publicsuffix/list/pull/2206

[Fixes #57]
2024-10-08 18:08:59 -07:00
Brian Cunnie
39d876079c Update SOA to 10/8
Lucy's birthday.
2024-10-08 09:09:24 -07:00
Brian Cunnie
63a2be439e Return NS records randomly
Previously when the NS records were returned, ns-aws was always returned
first. Coincidentally, 64% of the queries were directed to ns-aws. And
once I exceeded AWS's 10 TB bandwidth limit, AWS began gouging me for
bandwidth charges, and $12.66/month rapidly climbed to $62.30

I'm hoping that by randomly rotating the order of nameservers, the
traffic will balance across the nameservers.

Current snapshot (already ns-ovh is helping):

ns-aws.sslip.io
"Queries: 237744377 (1800.6/s)"
"Answered Queries: 63040894 (477.5/s)"

ns-azure.sslip.io
"Queries: 42610823 (323.4/s)"
"Answered Queries: 14660603 (111.3/s)"

ns-gce.sslip.io
"Queries: 59734371 (454.1/s)"
"Answered Queries: 17636444 (134.1/s)"

ns-ovh.sslip.io
"Queries: 135897332 (1034.4/s)"
"Answered Queries: 36010164 (274.1/s)"
2024-09-17 06:27:53 -07:00
Brian Cunnie
4111f7c1ba Update SOA to 9/15
In preparation of adding a new nameserver, ns-ovh.sslip.io
2024-09-15 06:48:45 -07:00
Brian Cunnie
ba85d1aacf 🐞 Remove incorrect -delegates warning
fixes, when server is started with `-delegates` unset:

```
-delegates: arguments should be in the format "delegatedDomain=nameserver", not ""
```
2024-07-04 05:47:45 -07:00
Brian Cunnie
48dd9269f9 Placate the linter
- `ip.String()` → `ip` might be nil

Drive-bys:

- better documentation for NameToA() and NameToAAAA()
- better naming: public → allowPublicIPs
2024-06-15 20:23:16 -07:00
Brian Cunnie
8a08e49034 Flag -delegates for delegated domains
Meant for obtaining wildcard certs from Let's Encrypt using the DNS-01
challenge.

- introduce a variant of `blocklist.txt` to be used for testing
  (`blocklist-test.txt`) because the blocklist has grown so large it
  clutters the test output
- more rigorous about lowercasing hostnames when matching against
  customized records. This needs to be extendend when we parse _any_
  arguments

TODOs:

- remove the wildcard DNS servers
- update instructions
2024-06-08 19:40:09 -07:00
Brian Cunnie
1bdd03fd39 Promote Golang code to the root of the repo
- That's where the code is expected to be
- The only reason the code was buried two directories down was because
  it was originally a BOSH release
- There hasn't been a BOSH release in over two years; last one was Feb
  26, 2022
- Other than a slight adjustment to the relative location of
  `blocklist.txt` file in the integration tests, there were no other
  changes
2024-05-11 10:14:23 -07:00