Hey everyone, I'm working on a project and I need some help. I want to send a DNS query from my machine, and I've created a binary query complete with the necessary headers. Is there a Linux command that allows me to send this binary file over the network? And does that command include a header? I really appreciate any guidance from those who are knowledgeable about this. Thanks!
3 Answers
You could use tools like `curl` or `nc` (netcat) since they can handle sending binaries along with headers quite easily! They're pretty straightforward to work with too.
Instead of assembling everything from scratch, why not use existing tools like `dig` or `nslookup`? Those are specifically designed for DNS lookups. If you're looking to send data over the network, check out Bash's pseudo-devices like `/dev/tcp` and `/dev/udp`. You can find more about that in various documentation online. Another solid option is `netcat` or `nc`, depending on what Linux distro you're using!
Unless you have a super specific reason, using `dig` is way easier and will save you a lot of hassle. Even low-level languages like C usually don’t write DNS packets by hand—there's no need to reinvent the wheel here!
Totally agree! Just look up the manual pages for those tools to get a solid understanding before diving deeper.
Honestly, the question seems a bit unclear. What are you trying to achieve by sending a DNS query this way? Are you trying to build something like rsync or FTP? It might help to clarify your end goal instead of just focusing on the implementation details.
I just want to understand how to send custom DNS queries effectively, but I see your point.

Thanks for the suggestion, I’ll check them out!