title: How does DNS Resolution work for protocols and ports?
body: <p>I am new to this so I wanted to ask some clarifying questions.
  I am clear on the path that a query can take for name resolution on dns servers.</p>
  <p>Where I get confused is how does this work when you specify a port or a protocol and are trying to resolve a name programmatically?</p>
  <p>For example using Boost Beast in C++</p>
  <pre><code>// Look up the domain name
  auto const results = resolver.resolve(host, port);
  </code></pre>
  <p>Would I have to know in advance whether that port is using http or https and rely on conventions, 80 for http, 443 for https? Can a port use both protocols so the protocol has to be specified too?
  Thank you in advance.</p>