Live data from Hacker News

Implement DNS in a Weekend

implement-dns.wizardzines.com

1–10 of 77 posts

Re: Implement DNS in a Weekend

#2
This is great. Incidentally, writing toy recursive resolvers is one of the primary methods I use to help me learn new languages. If you take the time to develop an understanding of the domain, I've found its an easily repeatable exercise and can be done in a couple of hours.

Re: Implement DNS in a Weekend

#4
I'll dig up my old comment about how easy DNS is to work with using DNS4J:

  Message query = new Message(data);
  Header header = query.getHeader();
  Record question = query.getQuestion();
  Message response = new Message(query.getHeader().getID());
  response.getHeader().setFlag(Flags.QR);
  response.addRecord(question, Section.QUESTION);
  Name name = question.getName();
  int type = question.getType();
  int dclass = question.getDClass();
  String host = name.toString(true).toLowerCase();
  ...
  response.addRecord(new ARecord(name, dclass, 300, "someIP"), Section.ANSWER);
  ...
  response.getHeader().setFlag(Flags.AA);
  return response.toWire(512);

Re: Implement DNS in a Weekend

#7
Enjoyed. I’ve been experimenting with parsing network protocols a lot lately with an eye to separating the parsing from the “logic” (usually combined in one handler). DNS (and DHCP) are the two I started with - having the flexibility to easily extend/alter the logic is useful from time to time (ala PiHole).

Re: Implement DNS in a Weekend

#9
post #3

Julia's zines[0] are great. Got mine this week and it's a delight to read. 0 - https://wizardzines.com

On Firefox mobile, I get some element overflow blocking the speech bubble. Maybe a flex wrap gone wrong?

Just a heads up incase Julia is reading :)

Post reply on HN