- Nix 1.11+ OR Ruby 2.3.x
If using Nix you can just load the environment with nix-shell shell.nix
.
Now we can test an entry via command-line using host
or dig
commands:
[nix-shell:~/src/github/mbbx6spp/ruby-dns-examples]$ host -tSRV _http._tcp.referentiallabs.rocks
_http._tcp.referentiallabs.rocks has SRV record 10 50 80 fake0.referentiallabs.rocks.
_http._tcp.referentiallabs.rocks has SRV record 10 50 80 fake1.referentiallabs.rocks.
Look at the code in srvexample0.rb
for Ruby code, and you can run it like so here:
[nix-shell:~/src/github/mbbx6spp/ruby-dns-examples]$ ruby srvexample0.rb
_http._tcp.referentiallabs.rocks has SRV record 10 50 80 fake1.referentiallabs.rocks.
_http._tcp.referentiallabs.rocks has SRV record 10 50 80 fake0.referentiallabs.rocks.
Cheers.