title: Which RFCs specify the syntax of hostnames and constraints on DNS hostnames?
body: <p>Regarding the syntax of hostnames, answers to questions like <a href="https://stackoverflow.com/questions/106179/regular-expression-to-match-dns-hostname-or-ip-address">this</a> often refer to <a href="https://www.rfc-editor.org/rfc/rfc1123" rel="nofollow noreferrer">RFC 1123</a> and <a href="https://www.rfc-editor.org/rfc/rfc952" rel="nofollow noreferrer">RFC 952</a>, but fail to mention <a href="https://www.rfc-editor.org/rfc/rfc921" rel="nofollow noreferrer">RFC 921</a> which seems to place additional restrictions on hostnames. There are probably a bunch of later RFCs about the <a href="https://en.wikipedia.org/wiki/Domain_Name_System" rel="nofollow noreferrer">DNS</a> (and <a href="https://en.wikipedia.org/wiki/Internationalized_domain_name" rel="nofollow noreferrer">IDN</a>) which cover constraints on hostnames handled by the DNS.</p>
  <p>There is a lot confusion around the valid syntax of hostnames and hostnames handled by the DNS.</p>
  <p>Which RFCs specify the syntax requirements on hostnames and which RFCs specify additional constraints on the hostnames handled by the DNS?</p>