Is it possible to add port field to a dns query response in theory? Typical Query&Response: google.com -> someip:80 (for http) Desired Query&Response: google.com ->someip:5666 (for http) so web browser can make http requests to not 80 but to 5666.
1 Answers
DNS resolves domain names to IP addresses, and knows next to nothing about ports.* An A or AAAA record has nowhere to put a port number. So no, you can't normally tack one on in any way clients will understand.
Some places, though -- often DNS hosting services -- offer a service known as URL forwarding. You point a domain name at their server, and they basically serve a redirect to your real site. With a redirect, the user typically sees the real URL, including the port number. They just doesn't have to type it in.
*Some types of records, like SRV records, have a field for a port number, and could actually answer a question like "Where's the HTTP server for yourdomain.com
?". But since real-world browsers don't query for SRV records, you don't gain much by having one.

- 84,970
- 20
- 145
- 172
-
what about the quic protocol if the webserver serves with quic ,does the chrome query the quic udp port ? – user818117 Dec 21 '17 at 11:15
-
Looks like chrome at least pings the udp port. It might ask the web server where the quic port is (I'm not sure how quic works), but doesn't ask DNS. The default assumption seems to be that it'll run on ports 80 and 443, just like http/https. – cHao Dec 21 '17 at 13:39