Skip to content

Instantly share code, notes, and snippets.

@zdk
Last active August 14, 2024 14:59
Show Gist options
  • Save zdk/407f58803bb8d06729615ac66ada8a70 to your computer and use it in GitHub Desktop.
Save zdk/407f58803bb8d06729615ac66ada8a70 to your computer and use it in GitHub Desktop.
Test SRV record query with Bun
import * as dns from "node:dns";
import { $ } from 'bun';
const addrs = await dns.promises.resolveSrv("_web1._tcp.mydomain.local");
console.log(addrs);
@zdk
Copy link
Author

zdk commented Aug 14, 2024

❯❯❯ time dig +short @127.0.0.1 -t SRV _web1._tcp.mydomain.local
0 5 7000 localhost.
dig +short @127.0.0.1 -t SRV _web1._tcp.mydomain.local 0.00s user 0.00s system 60% cpu 0.012 total
❯❯❯ time bun index.tsx
[
{
priority: 5,
weight: 5,
port: 7000,
name: "localhost",
}
]
bun index.tsx 0.01s user 0.01s system 72% cpu 0.029 total
~/D/t/test-bun ❯❯❯

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment