Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I'm using names like a.alpha for the hostname of my linux box, but it seams that these name are not completely usable. The response of a hostname shell command is correct (a.alpha). But the name printed after my user account is "user@a" instead of "user@a.alpha". When I use avahi, I can reach (by hostname) a.alpha, but not b.alpha. Is that normal?

share|improve this question
up vote 9 down vote accepted

Chopper is right. Due to how DNS works, the "alpha" component of "a.alpha" is considered a discrete 'label' in DNS. Using a hostname with a dot in it will cause inconsistent results from any system that consumes DNS.

Avahi does interact with DNS names, and specifically the <host-name> directive needs to have the DNS FQDN of the service in it, so it's also subject to DNS inconsistency with dotted names.

Don't use dotted name.

share|improve this answer
This is correct, but needs references to be considered a reliable answer. Someone saying 'Due to how DNS works' on Stack Overflow doesn't prove anything. – mikemaccana Apr 14 '15 at 10:12
Is it rigid rule that hostname cannot contain '.' ? – Dinesh Kumar P Jul 2 '15 at 11:42
@DineshKumarP Yes. The DNS RFCs describe the period character as the delimiter between DNS labels. While non-DNS services such as Avahi or SLP may allow it, DNS itself does not. – sysadmin1138 Jul 2 '15 at 14:11

You're asking for trouble with that naming scheme due to DNS, consider a-alpha instead.

share|improve this answer
I'v ask the same question on askubuntu, and no one can answer me nether. So i will use this method – benzen Jan 31 '11 at 21:02

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.