Commit Graph

54 Commits

Author SHA1 Message Date
Brian Cunnie
d987e155ea Include "nip.io" in the namerserver checks
Instead of checking only sslip.io, we expand our [4-times-per-day]
nameserver checks to include nip.io. This is a component of the
long-running campaign to promote the nip.io domain to full citizenship.
2025-07-24 18:57:46 -07:00
Brian Cunnie
548492a46e 4.1.1: nip.io has special-purpose TXT records
Also, I tidied the developer docs so that the output of the "smoke test"
was more readable.
2025-07-22 06:52:18 -07:00
Brian Cunnie
48efca61ef Make nameservers test more robust
The Nameservers test (in GitHub Actions), fails ~25% of the time, almost
invariably ns-do-sg.sslip.io (I don't know whether it's Digital Ocean's
fault or the large distance between my GitHub Actions runner &
Singapore).

The failures are noisy, typically one day, and have led me to stop
checking the status of my nameservers, which defeats the purpose.

This commit attempts to reduce the failures by increasing both the
timeout and the retries. We are nothing if not persistent.
2025-07-11 17:59:19 -07:00
Brian Cunnie
ddde94a4c8 4.1.0: hexadecimal notation 2025-06-23 05:10:08 -07:00
Brian Cunnie
a43dc4a057 4.0.0: nip.io 2025-06-15 16:14:05 -07:00
Brian Cunnie
dbc1d3c70c 🐞 Nameservers test: whois is a subset of NS
Slight tweak: I want every WHOIS nameserver to be reflected in the NS
records, but I also want to allow for additional NS records.
Specifically, I've paid the Google Cloud Platform (GCP) "Committed Use
Discounts" for `ns-gce.sslip.io`, but it attracts *lots* of traffic, and
that can easily incur $100+ in bandwidth charges per month. To tamp down
on traffic, I don't include `ns-gce` in the whois nameservers, but I do
include it in the NS records.

But then my tests fail, so this commit tweaks the tests so that as long
as the NS records are a superset of the whois records, I'm fine
(previously they had to match).

Fixes, when running `DOMAIN=sslip.io rspec --format documentation
--color spec/`:

```
rspec './spec/check-dns_spec.rb[1:3]' # sslip.io nameserver ns-ovh.sslip.io.'s NS records match whois's ["ns-ovh.sslip.io.", "ns-hetzner.sslip.io.", "ns-do-sg.sslip.io."], `dig @ns-ovh.sslip.io. ns sslip.io +short`
rspec './spec/check-dns_spec.rb[1:18]' # sslip.io nameserver ns-hetzner.sslip.io.'s NS records match whois's ["ns-ovh.sslip.io.", "ns-hetzner.sslip.io.", "ns-do-sg.sslip.io."], `dig @ns-hetzner.sslip.io. ns sslip.io +short`
rspec './spec/check-dns_spec.rb[1:33]' # sslip.io nameserver ns-do-sg.sslip.io.'s NS records match whois's ["ns-ovh.sslip.io.", "ns-hetzner.sslip.io.", "ns-do-sg.sslip.io."], `dig @ns-do-sg.sslip.io. ns sslip.io +short`
```
2025-05-24 07:51:03 -04:00
Brian Cunnie
e5450f579a ns-ovh-sg → ns-do-sg; +ns-gce
We replace `ns-ovh-sg` with `ns-do-sg`; this is a purely financial
decision: `ns-ovh-sg` costs $60/month, $720/year.

`ns-do-sg` (Digital Ocean), is also a Singapore-based DNS server. It's a
basic-regular-2vcpu-4GiB RAM-80GB SSD-4TiB bandwidth for $24/month,
$288/year.

That's a yearly savings of $432.

I had originally overspec'ed the Singapore server because I suspected
that there was a ton of traffic in Asia; I was wrong. It's not even 20%
the traffic of Europe or North America. I am confident the Digital Ocean
server will be able to handle it.

I also reintroduce `ns-gce` as the second server in North America, backing
up `ns-hetzner`. My hope is that `ns-hetzner` carries most of the load,
and `ns-gce` carries the rest, but not so much as to trigger Google
Cloud Platform's (GCP's) expensive bandwidth billing.

| DNS server | Queries / second |
|:-----------|-----------------:|
| ns-hetzner |          10706.4 |
| ns-ovh     |          10802.0 |
| ns-ovh-sg  |           1677.7 |
2025-05-20 20:56:47 -04:00
Brian Cunnie
50e6d71ee4 ns-gce is dead! Long live ns-ovh-sg!
I'm worried the traffic to my GCP server will cost me a hundred dollars
in bandwidth fees. It has a volume similar to my late AWS server which,
in its last month, racked up ~$130 in bandwidth fees!

I'm also trying to balance the servers more geographically: instead of
having two servers in the US and none in Asia, I'll have one server in
the US and one in Asia (Singapore).

The OVH server in Asia is expensive — $60/month instead of $20/month for
the OVH server in Warsaw. Also there's a monthly bandwidth cap in
Singapore in addition to the 300 Mbps cap.

I went with a dedicated server, similar to the one in Warsaw, but I took
the opportunity to upgrade it (same price):

- ns-ovh:    KS-4: Intel Xeon-E3 1230 v6
- ns-ovh-sg: KS-5: Intel Xeon-E3 1270 v6

I'm hoping that by adding this server to Singapore, the traffic to the
ns-ovh, the Warsaw server, will lessen, and I won't get thos "Anti-DDoS
protection enabled for IP address 51.75.53.19" emails every few days.

Current Queries per second:

- 4,087 ns-gce
- 1,131 ns-hetzner
- 7,183 ns-ovh
2025-04-27 06:30:43 -07:00
Brian Cunnie
64cf7b6bc1 3.2.6: -ns-azure, ns-aws → "blocked" 2025-01-04 11:51:18 -08:00
Brian Cunnie
508f058a7a 3.2.5: Minor bugfixes, tweaks 2024-12-03 11:07:07 -08:00
Brian Cunnie
1da3b67af2 3.2.4: Introduce new nameserver, ns-hetzner.sslip.io 2024-11-16 17:26:04 -08:00
Brian Cunnie
c6c5435e4a 3.2.3: ns-aws is no longer an NS for sslip.io 2024-11-04 18:14:17 -08:00
Brian Cunnie
078a69f75e 3.2.2: Join the Public Suffix List 2024-10-08 18:53:08 -07:00
Brian Cunnie
d0c3927415 3.2.1: Return NS records in random order 2024-09-17 06:34:32 -07:00
Brian Cunnie
c4310ebb86 3.2.0: Introduce new nameserver, ns-ovh.sslip.io 2024-09-15 17:45:01 -07:00
Brian Cunnie
27d7f4bcd6 3.1.0: Shorten TTL for publicly-accessible A & AAAA records 2024-03-09 07:20:50 -08:00
Brian Cunnie
aacd566ab4 3.0.0: enable TCP binding in addition to UDP 2023-10-04 08:07:03 -07:00
Brian Cunnie
3e688e61de dns-servers test: remove key-value tests
We are no longer doing key-value-over-DNS.

Fixes <https://ci.nono.io/teams/main/pipelines/sslip.io/jobs/dns-servers/builds/1097>
```
rspec './spec/check-dns_spec.rb[1:17:1]' # sslip.io k-v.io tested on the ns-aws.sslip.io. nameserver sets a value, 1678804743, on the key sslipio-spec.k-v.io
rspec './spec/check-dns_spec.rb[1:17:2]' # sslip.io k-v.io tested on the ns-aws.sslip.io. nameserver gets the newly-set value, 1678804743, from the key, sslipio-spec.k-v.io
rspec './spec/check-dns_spec.rb[1:33:1]' # sslip.io k-v.io tested on the ns-azure.sslip.io. nameserver sets a value, 1678804743, on the key sslipio-spec.k-v.io
rspec './spec/check-dns_spec.rb[1:33:2]' # sslip.io k-v.io tested on the ns-azure.sslip.io. nameserver gets the newly-set value, 1678804743, from the key, sslipio-spec.k-v.io
rspec './spec/check-dns_spec.rb[1:49:1]' # sslip.io k-v.io tested on the ns-gce.sslip.io. nameserver sets a value, 1678804743, on the key sslipio-spec.k-v.io
rspec './spec/check-dns_spec.rb[1:49:2]' # sslip.io k-v.io tested on the ns-gce.sslip.io. nameserver gets the newly-set value, 1678804743, from the key, sslipio-spec.k-v.io
```
2023-03-14 10:40:04 -04:00
Brian Cunnie
451ad0ef5f 2.7.0: remove key-value store 2023-03-13 16:46:20 -04:00
Brian Cunnie
776fe532ce 2.6.2: -quiet suppresses logs for each query 2022-11-26 13:55:38 -08:00
Brian Cunnie
262a1e0ea1 2.6.1: -addresses flag enables custom addresses 2022-11-11 10:48:37 -08:00
Brian Cunnie
6363636c21 Hygeine: Ruby: Use shorter regexps
`[0-9]` → `\d`, `[0-9a-f]` → `[[:xdigit:]]`

A follow on to the previous commit, which did the same for Golang.

Ruby supports the above matchers like Golang does:
<https://ruby-doc.org/core-3.1.2/Regexp.html>
2022-07-22 12:47:14 -04:00
Brian Cunnie
f598bb52c7 Version 2.6.0: PTR records for IPv4 & IPv6 2022-07-14 18:34:40 -07:00
Brian Cunnie
50d843a16a Version 2.5.4: .acme_challenge.k-v.io isn't settable 2022-04-30 16:42:35 -07:00
Brian Cunnie
4d339cd861 Version 2.5.3: k-v.io is operational 2022-04-22 14:33:47 -07:00
Brian Cunnie
19668fac7f CI: rigorously test k-v.io
We make sure that each of the three nameservers
(ns-{aws,azure,gce}.sslip.io) can set a key-value, that the value
propagates to the remaining nameservers, that a nameserver can delete a
key, and that the deletion propagates to the remaining nameservers.
2022-04-20 16:48:50 -07:00
Brian Cunnie
294f54a79a Version 2.5.2: DELETE on k-v.io returns no TXT records
The original behavior was to return the deleted record, which
inadvertently prolonged the lifetime (in DNS cache) of the record which
was meant to expire as soon as possible.

- Removed the instructions to create a BOSH release. We are no longer
  creating a BOSH release because we needed to colocate an etcd release
  alongside the BOSH release, and we couldn't find an etcd BOSH release.
- Updated the instructions to run a quick test against the sslip.io DNS
  server locally (sanity check) instead of deploying a VM with the BOSH
  release & testing against that.
- Updated the instructions for updating ns-azure's DNS server. ns-azure
  is no longer a BOSH-deployed VM.
2022-04-13 12:55:34 -07:00
Brian Cunnie
2a0e6b105d Health checks conform to new key-value delete behavior
When we check the production servers, we now expect, when we delete a
key, to NOT receive the key's old value as a response, lest we
inadvertently extend the lifetime of the key that we want to expire.
2022-04-13 08:35:21 -07:00
Brian Cunnie
cd2b14b924 BOSH release: 2.5.1: block phishers with CIDRs 2022-02-26 16:41:05 -08:00
Brian Cunnie
51ed47317e BOSH release: 2.5.0: block phishers 2022-02-06 19:51:06 -08:00
Brian Cunnie
8f2890d90e BOSH release: 2.4.2: fix panic() 2022-01-22 09:41:49 -08:00
Brian Cunnie
c61b81c29b Server tests: update for new endpoints
fixes:
<https://ci.nono.io/teams/main/pipelines/sslip.io/jobs/dns-servers/builds/271>
2022-01-20 09:50:58 -08:00
Brian Cunnie
bbf1925be4 BOSH release: 2.4.1: fewer panics
customized records w/ non-existent TXTs don't panic().
2022-01-20 08:10:03 -08:00
Brian Cunnie
e215c4fda4 🐞 Don't panic() invoking a customized TXT
We made a mistake: we blindly invoked a function that was sometimes
`nil`. Specifically, if we had a customized domain (e.g. `ns.sslip.io`)
that didn't have a TXT record (a function), we'd try to invoke it
anyway. Bad move.

Now we ensure the function is there before we try to invoke it.

This is a curious affirmation of installing metrics: if we hadn't seen
that the server had been restarted because uptime was too low, we
wouldn't have caught this bug.

Drive-by: we made the lengths of TXT records of `version.status.sslip.io`
exactly match what we replace them with during the linking phase. We
hope that this fixes the wrong-line-numbers we see in the `panic()`
messages.

[fixes #14]
2022-01-20 07:47:48 -08:00
Brian Cunnie
b119442a37 BOSH release: 2.4.0: metrics.status.sslip.io returns metrics
Also, I moved the "versio" endpoint: `version.sslip.io` →
`version.status.sslip.io`. It seemed to make more sense to corral the
special endpoints under `status`.
2022-01-20 05:02:21 -08:00
Brian Cunnie
30141f1d90 CI: Test key-value store regularly 2021-12-04 10:31:12 -08:00
Brian Cunnie
bd63421c3f BOSH release: 2.3.0: kv.sslip.io key-value store 2021-12-04 08:16:53 -08:00
Brian Cunnie
90b94baa29 BOSH release: 2.2.4: Deprecate nono.io nameservers 2021-11-28 13:08:49 -08:00
Brian Cunnie
4e22123114 BOSH release: 2.2.3: Include sslip.io nameservers 2021-11-27 11:35:01 -08:00
Brian Cunnie
854d8e8c1b Spec: test ip.sslip.io
Also, change the order of `dig` arguments so that the server being
queried is first (e.g. `@#{whois_nameserver}`) and the arguments (e.g.
`+short`), is last.
2021-11-05 08:10:39 -07:00
Brian Cunnie
1d4e1af656 Production test: all servers run same version 2021-11-02 05:02:46 -07:00
Brian Cunnie
a37bbc150c CI: check sslip.io's A & AAAA records, and website
- The impetus? I deployed a custom webserver but forgot to add the
  A & AAAA records for sslip.io, so the website disappeared.
- I now check for the A & AAAA records (to be present, but not of any
  particular value because that gives me the latitude to migrate to
  other machines).
- I also check that the website is responsive.
- drive by: removed hard-coding of `sslip.io` in many tests; instead we
  now query the domain that the env var `DOMAIN` is set to.
2020-12-01 10:01:08 -08:00
Brian Cunnie
09249be0a0 CI: don't double-count the nameservers
On macOS, `whois` returns _two_ results for the domain `sslip.io` from
two different whois servers:

- whois.nic.io
- whois.namecheap.com

This means that every nameservers is double-counted. To fix, we remove
the duplicates.

fixes:
```
     Failure/Error: expect(dig_nameservers.sort).to eq(whois_nameservers.sort)

       expected: ["ns-aws.nono.io.", "ns-aws.nono.io.", "ns-azure.nono.io.", "ns-azure.nono.io.", "ns-gce.nono.io.", "ns-gce.nono.io."]
            got: ["ns-aws.nono.io.", "ns-azure.nono.io.", "ns-gce.nono.io."]

       (compared using ==)
     # ./spec/check-dns_spec.rb:44:in `block (3 levels) in <top (required)>'
```
2020-12-01 09:22:24 -08:00
Brian Cunnie
06f1556699 Revert "dig shouldn't bomb-out if forbidden hyphen is used"
DiG 9.10.6 no longer has the `+noidn` option, and `dig` will error if we
try to use it.

fixes:
```
dig +short +noidnin ns sslip.io @ns-azure.nono.io.
Invalid option: +noidnin
```

And this previously-invalid dig query now works, so we don't need the
option anyway:
```
dig +short AAAA api.--.sslip.io
::
```

This reverts commit a2564c12d3.
2020-12-01 09:17:08 -08:00
Brian Cunnie
a2564c12d3 dig shouldn't bomb-out if forbidden hyphen is used
Yes, according to the RFC it shouldn't begin with a hyphen. And, since
we're on the topic, underscores were supposed to be off the table, too,
but Microsoft used them anyway, and you know what? We're gonna use the
"forbidden hyphen". And we're gonna instruct `dig` to not be so
persnickety.

fixes:
```
dig +short  AAAA api.--.sslip.io
dig: idn2_lookup_ul failed: string start/ends with forbidden hyphen
```

I had to make it work for old-style (e.g. macOS dig) which is version
"DiG 9.8.3-P1" as well as for the new version ("DiG
9.11.3-RedHat-9.11.3-6.fc28") which has this new
[library](https://www.gnu.org/software/libidn/libidn2/reference/libidn2-idn2.html)
which does the following:

> Perform IDNA2008 lookup string conversion on domain name src , as described in section 5 of RFC 5891
2018-05-23 20:03:34 -07:00
Brian Cunnie
859107de14 🐞 Don't test resolution of Google's IPv6 DNS server twice
Instead, test one of my IPs.
2017-12-10 07:18:16 -08:00
Brian Cunnie
2642344d44 Test FQDNS -> IPv6 addresses 2017-12-10 06:27:58 -08:00
Brian Cunnie
3844f98c28 Unit tests show which command is being run
- helps me troubleshoot; I get lost at times.
- README shows more verbose variant of rspec
2017-09-21 06:01:10 -07:00
Brian Cunnie
a549b5b74d Nameservers should be lowercased
fixes:
```
nameserver NS-AZURE.NONO.IO.'s NS records match whois's ["NS-AZURE.NONO.IO.", "NS-AWS.NONO.IO.", "NS-HE.NONO.IO.", "NS-GCE.NONO.IO."] (FAILED - 1)
```
2017-07-05 13:57:42 -07:00
Brian Cunnie
e779757527 Adjust to new whois format:
- previously Name Server line began with "NS"
- now they begin with "Name Server"
- fixed typo

fixes:
```
1) sslip.io should have at least 2 nameservers
   Failure/Error: expect(whois_nameservers.size).to be > 1

     expected: > 1
          got:   0
   # ./sslip.io/spec/check-dns_spec.rb:37:in `block (2 levels) in <top (required)>'
```
2017-07-01 06:38:16 -07:00