Live data from Hacker News

DNS Toys

dns.toys

61–70 of 111 posts

Re: DNS Toys

#61
"Prior art" for this is DNS block lists (DNSBLs).

Typically these are used like this: your mail server gets an SMTP connection from some address (let's use the familiar IPv4 example): 10.20.30.40.

You reverse these octets and do an "A" record dns query to some 40.30.10.10.dnsbl.example.com to look up that IP in example.com's list. If a match is returned, the address is listed. If you do a "TXT" record query, you can find out why it's listed.

Block lists are typically blacklists, but they can be whitelists as well.

DNSBL's are hammered with queries from vast numbers of mail servers; DNS keeps things efficient.

Re: DNS Toys

#62

“Why? For fun.” I love this. It doesn’t need a reason to exist. It’s interesting on its own. That being said, can anyone think of additional interesting reasons for why this would be useful rather than the same toys over HTTP?

My default is the other way around, I'll question why something that is not a web page uses HTTP as an application-layer protocol when better fitted alternatives usually exist.

Add a bonus withering stare for assuming JSON is the only data serialization/interchange format.

Re: DNS Toys

#63

“Why? For fun.” I love this. It doesn’t need a reason to exist. It’s interesting on its own. That being said, can anyone think of additional interesting reasons for why this would be useful rather than the same toys over HTTP?

This may work on pay to use Wi-Fi. There was a previous interesting post here about tunneling through DNS on airplane or other pay to use Wi-Fi. https://news.ycombinator.com/item?id=511908

I have used this trick when I in high school grade.

Just setup openvpn with port 53 UDP with cheap vps, then connect it, and get unlimited internet access

Internet connection in my country is very limited and expensive in that day

Re: DNS Toys

#66

Earlier quoted context omitted.

Simplicity / latency / efficiency - DNS typically just fires off one UDP packet (generally one IP packet & ethernet frame too) and then gets one back (hopefully) and it's done. HTTP requires the TCP 3-way connection handshake, then the out & back roundtrip for request/response, then the 4-way teardown handshake. If it's HTTPS you also need the 4-way TLS Anyway if you're using a 14.4 modem in a rusty bunker at the bot…

This. I measured the difference using `tcpdump`, and this was my conclusion: > A big advantage of using DNS queries instead of HTTP queries is bandwidth: querying ns-aws.sslip.io requires a mere 592 bytes spread over 2 packets; Querying https://icanhazip.com/ requires 8692 bytes spread out over 34 packets—over 14 times as much! Admittedly bandwidth usage is a bigger concern for the one hosting the service than the on…

To be fair in the comparison; you can also query (via curl) icanhazip.com via HTTP instead of HTTPS, and it is only 5 packets and 385 bytes.

Re: DNS Toys

#67
post #47

This is awesome but I'm getting NXDOMAIN when I try to use it. Am I doing something wrong, perhaps something to do with EDNS? $ dig 42km-mi.unit @dns.toys ; > DiG 9.16.27-Debian > @dns.toys 42km-mi.unit ; (1 server found) ;; global options: +cmd ;; Got answer: ;; ->>HEADER

[deleted]

Re: DNS Toys

#68
post #48

Picky overcorrect comment: Try dig +short instead of dig +noall +answer +additional i.e. dig +short mumbai.time @dns.toys gives you the short and breve answer you probably expect :-)

Not quite, some queries have multiple records and multiple response fields, so it's necessary to do:

  dig +short london.time @dns.toys |head -n 1 |cut -d '"' -f4
In order to get clean time for a city, for example. At which point you'd be better learning the arguments to local tools. But anyway, cute hack and cool mountain-name. :)

Re: DNS Toys

#69
the one where you can get the weather reminds me of graph.no, a service where you can retrieve the weather using the Finger Protocol.

e.g.

   finger new_york@graph.no

Re: DNS Toys

#70

Really pleasing - though the most surprising thing was learning a forward slash is a valid character in a domain name. Are there any real world examples?

Domain names can't have slashes. But I think the DNS protocol just works with binary strings that are up to 255 bytes long (or was it 256?). So I guess most CLI DNS tools don't care if it is a valid domain name.
Post reply on HN