Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Is smoltcp::socket::dns only a DNS client or also a DNS server? #785

Open
vi opened this issue May 10, 2023 · 2 comments
Open

Is smoltcp::socket::dns only a DNS client or also a DNS server? #785

vi opened this issue May 10, 2023 · 2 comments

Comments

@vi
Copy link

vi commented May 10, 2023

smoltcp::socket::dns has no module-level documentation.

smoltcp::socket::dns::Socket's documentation ("A Domain Name System socket. A UDP socket is bound to a specific endpoint, and owns transmit and receive packet buffers.") also does not make clear which features are supported and which are not.

  • Can it do recursive DNS lookup?
  • Can it used for implementing a DNS server, not for using DNS server?
  • Can it decode captured DNS query and/or answer (not the one created by smoltcp::socket::dns)?
@vi vi changed the title Is smoltcp::socket::dns only DNS client or also DNS server? Is smoltcp::socket::dns only a DNS client or also a DNS server? May 10, 2023
@Dirbaio
Copy link
Member

Dirbaio commented May 10, 2023

Can it do recursive DNS lookup?

No.

Can it used for implementing a DNS server, not for using DNS server?

No, client only.

Can it decode captured DNS query and/or answer (not the one created by smoltcp::socket::dns)?

Not sure what you mean. It parses the answer, you can obtain the IP address list from it with this function https://docs.rs/smoltcp/latest/smoltcp/socket/dns/struct.Socket.html#method.get_query_result

@vi
Copy link
Author

vi commented May 10, 2023

Thanks for the answer. This should be in the docs.

I expected there to be something like dns_parser::Packet::parse. Smoltcp's analogue seems to be smoltcp::wire::DnsPacket, though it exposes only basic things. Existence of DNS-related code on wire level can also acknowledged in smoltcp::socket::dns docs, as this module is the first search result when looking up "dns".

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

No branches or pull requests

2 participants