[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 652
  • Last Modified:

Windows assign a hostname

An easy one for the Windows guys -
How do we add a hostname a.b.c.com to a windows server 2008 R2. This is a stand alone server with no DNS configured.
0
legolasthehansy
Asked:
legolasthehansy
  • 2
  • 2
  • 2
1 Solution
 
smckeown777Commented:
Then you can't...

Hostnames can't contain '.' in the name

What you have shown there is a hostname of
a
with a subdomain of b
another subdomain c
and the final domain .com

Without a DNS server and the same zones setup this isn't possible...

What is it you are trying to achieve?
0
 
Frosty555Commented:
If you do not have any network-based name resolution services available (e.g. no local DNS server), then the only way to manually define a hostname is to put it into the "hosts" file in C:\windows\system32\drivers\etc.

You would tack the following line into the bottom of the hosts file:

123.123.123.123     a.b.c.com

Where "123.123.123.123" is what you want a.b.c.com to resolve to.

This only affects the single individual computer who's "hosts" file you modified. E.g. if you modify the "hosts" file on your Windows Server machine, only that machine will resolve a.b.c.com correctly.

This is appropriate as a quick solution when you need a hostname defined on just one or two specific computers. If you need something that works network-wide.... install the DNS service on your windows server and start using it!
0
 
legolasthehansyAuthor Commented:
Thanks - This was what I was looking for.
0
Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
legolasthehansyAuthor Commented:
I guess I gave up too soon on this one -

On right click My Computer -> Under Computer Name, Domain and Workgroup settings, Click change settings -> Click on More -> In Primary DNS suffix of this computer give b.c.com and click OK and in computer name give a

That should do it.
0
 
smckeown777Commented:
Nice, good solutions, never tried that one before...
0
 
Frosty555Commented:
A bit more clarification on legolasthehansy's suggestion - this ultimately uses DNS for name resolution but provides several "shortcuts" useful for reducing the maintenance needed in a changing network environment.

By giving the computer a primary DNS suffix of "b.c.com", it means that when you attempt to resolve names that are NOT fully qualified domain names, it will tack the suffix onto the end of the name. For example you try to resolve "mycomputer", the system will automatically assume you really meant "mycomputer.b.c.com", and perform DNS resolution on that name. This lets users just type the beginning part of the computer name instead of having to always type the FQDN, but it is strictly a shortcut.

When you give a computer a name (e.g. in System Properties->Computer Name), you are giving the computer a hostname which it will report to the network in two ways:

       - NetBIOS
       - Automatic registration with the local DNS server

NetBIOS is a flaky cludge of a name resolution service that Windows automatically implements, it works sometimes for network discovery but I generally suggest avoiding it altogether as it usually just confuses things, so I won't talk about that further.

More interesting is the automatic DNS registration - in domain environments with a local DNS server, computers on the network can register themselves automatically. This alleviates the network administrator's headache of having to manually maintain all the "A" records of all the desktops and laptops on the network.

In a windows domain environment, computers can join the domain, and then report their hostnames to the local DNS server. Other computers apply a similarly named DNS suffix. The end result is you can just ping computers by their hostname and everything "magically" resolves and works.
0

Featured Post

NFR key for Veeam Backup for Microsoft Office 365

Veeam is happy to provide a free NFR license (for 1 year, up to 10 users). This license allows for the non‑production use of Veeam Backup for Microsoft Office 365 in your home lab without any feature limitations.

  • 2
  • 2
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now