DNS look-up of name that is already RFC 1035 encoded

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

DNS look-up of name that is already RFC 1035 encoded

Craig McQueen
DHCP option 120 provides SIP server address(es), which may be an IP address or a DNS name. If it's a DNS name, then it is already encoded in the encoding used for DNS look-ups (RFC 1035). See RFC 3361 section 3.1.

What is the best way to look up such a name via lwIP? Shall I convert it from the RFC 1035 encoding to the normal dotted string notation, and not fret about the perceived inefficiency that lwIP will just convert it back to RFC 1035 encoding? (it's converted in dns_send().) Alternatively, core/dns.c could be modified to provide an API function that takes a hostname in the RFC 1035 encoding.

RFC 3361 section 3.1 says "RFC 1035 encoding was chosen to accommodate future internationalized domain name mechanisms." I'm not sure what that means, because I've not really looked into DNS internationalization and Punycode. So I'm not sure if lwIP supporting DNS look-ups in RFC 1035 encoding would somehow help support internationalized DNS names.

--
Craig McQueen


_______________________________________________
lwip-users mailing list
[hidden email]
https://lists.nongnu.org/mailman/listinfo/lwip-users
Reply | Threaded
Open this post in threaded view
|

Re: DNS look-up of name that is already RFC 1035 encoded

goldsimon@gmx.de
On 12.11.2018 01:04, Craig McQueen wrote:
> DHCP option 120 provides SIP server address(es), which may be an IP address or a DNS name. If it's a DNS name, then it is already encoded in the encoding used for DNS look-ups (RFC 1035). See RFC 3361 section 3.1.
>
> What is the best way to look up such a name via lwIP?

The only lookup lwIP supports is the normal dotted string notation.

> Shall I convert it from the RFC 1035 encoding to the normal dotted string notation, and not fret about the perceived inefficiency that lwIP will just convert it back to RFC 1035 encoding? (it's converted in dns_send().) Alternatively, core/dns.c could be modified to provide an API function that takes a hostname in the RFC 1035 encoding.

dns.c implements a cache. Taking one name as RFC1035 is not enough:
future comparisons must match it, too. So either we're buffering in
RFC1035 or in dotted strings. I'd say given the length of such names
(and unless there's a different point in keeping names in RFC1035
format), it's probably not worth changing anything from the current state...

Simon

_______________________________________________
lwip-users mailing list
[hidden email]
https://lists.nongnu.org/mailman/listinfo/lwip-users
Reply | Threaded
Open this post in threaded view
|

Re: DNS look-up of name that is already RFC 1035 encoded

Craig McQueen
[hidden email] wrote:

> On 12.11.2018 01:04, Craig McQueen wrote:
> > DHCP option 120 provides SIP server address(es), which may be an IP
> address or a DNS name. If it's a DNS name, then it is already encoded in the
> encoding used for DNS look-ups (RFC 1035). See RFC 3361 section 3.1.
> >
> > What is the best way to look up such a name via lwIP?
>
> The only lookup lwIP supports is the normal dotted string notation.
>
> > Shall I convert it from the RFC 1035 encoding to the normal dotted string
> notation, and not fret about the perceived inefficiency that lwIP will just
> convert it back to RFC 1035 encoding? (it's converted in dns_send().)
> Alternatively, core/dns.c could be modified to provide an API function that
> takes a hostname in the RFC 1035 encoding.
>
> dns.c implements a cache. Taking one name as RFC1035 is not enough:
> future comparisons must match it, too. So either we're buffering in
> RFC1035 or in dotted strings. I'd say given the length of such names (and
> unless there's a different point in keeping names in RFC1035 format), it's
> probably not worth changing anything from the current state...

I looked into DNS internationalization and Punycode. I can't see any problem with internationalization with either RFC1035 encoding or dotted string notation. So I think that's not a concern, regardless of what RFC3361 stated about internationalization.

So, I think the most straight-forward solution is for my code to just convert from the RFC 1035 encoding to dotted string notation, and avoid fretting about the double conversion.

--
Craig McQueen


_______________________________________________
lwip-users mailing list
[hidden email]
https://lists.nongnu.org/mailman/listinfo/lwip-users