大网数据广告活动
服务器运维问答

What to put as hostname in VPS setup?

· 52CE 我爱测

If my domain is example.com , what should I put as hostname in my VPS setup using Debian 8.7 Jessie? Is it www.example.com or example.com or example ?

问题原文

原帖链接 · user412945 · CC BY-SA 3.0

If my domain is example.com, what should I put as hostname in my VPS setup using Debian 8.7 Jessie? Is it www.example.com or example.com or example?

社区高分解答

原帖链接 · user · CC BY-SA 3.0

Like EEAA said, you can put in basically whatever you want.

That said, I do recommend having some kind of naming strategy for your hosts. Even if you only have a single VPS currently, it's not at all unheard of to grow systems horizontally over time, or to split services that were once co-located on a single server onto different servers.

Such a naming scheme can be as fancy or as boring as you like. You could use for example names of games (soccer, chess, ...), astronomical objects (proxima-centauri, saturn, ...), cities, species of animal, or just technical names that directly reflect the function of the particular host (such as ns2 or mail1). If the people you work for lack humor, I recommend purely technical names, or even a simple sequential scheme (to my knowledge, nobody ever got fired for naming a system server04).

I also strongly suggest putting the names under a domain name under your control. It's not actually a requirement, but doing so will save you from many headaches in the future. Then add whatever names you come up with to that domain name in DNS.

So if you have registered example.com then you might put in luna.example.com or chess.example.com or whatever else strikes your fancy.

You should strive to pick names that are unlikely to conflict with any public names you might reasonably want to use in the future which aren't guaranteed to be served by this particular host for as long as this particular host exists.

You can then configure the software running on that host to serve content for any host name of your choosing, and publish any host name of your choosing. Just because the physical (or in this case, virtual) host is known by an astronomical name doesn't mean you can't serve www.example.com off it.

摘自公开归档,保留原文语言,版式经整理,外部媒体与邮箱地址已移除。

资料来源与适用范围

资料来源
Server Fault
适用范围
以原帖系统、软件版本与发布日期为准(2017-04-28)
内容语言
中文;命令、路径和错误标识保留技术原文
本地收录日期
2026-11-15
授权说明
CC BY-SA 3.0

正文与所需资源由本站本地存储。查看来源及更新记录 ↗

请按适用版本和实际日志确认原因;本站没有对每一种系统或设备逐项执行文中的操作。