# Why Valid Hostname Checks Are More Complex Than a Simple Regular Expression

DevFeed: [Why Valid Hostname Checks Are More Complex Than a Simple Regular Expression](<https://devfeed.tech/articles/what-s-in-a-hostname-30188.md>)

Original publisher: [Read original article](<https://www.netmeister.org/blog/hostnames.html>)

Published: 2021-10-19T02:50:51Z

Content type: article

Language: en

Sources: [Signs of Triviality](<https://devfeed.tech/sources/signs-of-triviality.md>)

Topics: [Regular expression](<https://devfeed.tech/topics/regular-expression.md>)

Tags: [dns](<https://devfeed.tech/tags/dns.md>), [expression](<https://devfeed.tech/tags/expression.md>)

## AI overview

The article explains that validating hostnames is more complicated than using a simple regular expression because hostnames are DNS labels.

## Source excerpt

The common definition of a 'valid hostname' is often reduced to a simple regular expression, but as the saying goes: 'Now you have two problems.' Because hostnames are DNS labels and those... well, it's the DNS. All bets are off.