Alexander's Blog

Sharing knowledge with the global IT community since November 1, 2004

Windows Computer Name: Best Practices and Recommendations

/
/
img

After a new installation of Windows Server (e.g. Windows Server 2019) or Windows client (e.g. Windows 10 Professional), the computer is assigned a random 15-character computer name, which looks something like this: WIN-VPLD4SB9KWG. The technical name for the computer name is NetBIOS name. NetBIOS is an abbreviation for Network Basic Input/Output System and it’s used by applications to communicate over a local area network (LAN). Simply put, a computer name (i.e. NetBIOS name) is used by computers to communicate over a LAN.



Here are some useful points to remember:

  • Every Windows computer must have a computer name, also known as NetBIOS name, which can be between 1 and 15 characters long.
  • Every Windows computer must have a hostname and an IP address to communicate with computers across the Internet.
  • There is no difference between the term computer name and NetBIOS name. They are exactly the same thing.
  • By default, computer name, NetBIOS name, and Hostname of a Windows computer are exactly the same and you should keep it that way.
  • Hostnames are used by DNS Servers for name resolution on the Internet and on the LAN. NetBIOS names are used by the WINS Server only on the LAN. WINS is an older technology and it’s rarely used anymore.
Computer name and NetBIOS name are the same. NetBIOS name is the technical name, but people often find it easier to use the term Computer name.

Allowed Characters in NetBIOS Names

A NetBIOS name consists of 16 characters. However, the 16th character is reserved for NetBIOS Suffix, which identifies the service type for the registered name. You can type nbtstat -n (make sure n is in lowercase) at the command prompt to see the NetBIOS name, type, and status in a NetBIOS local name table. The 16th byte will tell you what type of service is running on the computer (e.g. RAS, workstation, etc.). Check out the NetBIOS Suffix Definitions table at the end of this article. I am adding it as a reference here. Because the 16th character is reserved, the computer name can only consist of 15 characters. According to Microsoft, the following characters are allowed in NetBIOS Names.

  • All alphanumeric ASCII characters (letters A-Z and numbers 0-9)
  • Although numbers are allowed, you can’t have a NetBIOS name that only contains number (e.g. 1234567) due to a DNS restriction.
  • Although underscore (_)can be used in a NetBIOS name, it’s not allowed in a DNS hostname so your computer will fail to communicate on the Internet. There’s more on this later in this article.
  • Although hyphen (-) is allowed in a NetBIOS name, I don’t recommend it. There’s more on this in the next section.
  • Period was allowed in older operating systems (except at the beginning of a name), but Microsoft has discouraged using a period since Windows 2000.

Disallowed Characters in NetBIOS Names

You cannot use the following characters in a NetBIOS name:

  • period (.)
  • backslash (\)
  • forward slash (/)
  • colon (:)
  • asterisk (*)
  • question mark (?)
  • quotation mark (“)
  • less than sign (<)
  • greater than sign (>)
  • vertical bar (|)

Disallowed Characters in Hostnames

As I mentioned earlier, the NetBIOS name and hostname are the same by default. This means you need to make sure that your NetBIOS name is using characters that are allowed in DNS hostnames. This is an important concept to grasp. If I am not making it clear, please post a comment so I can clarify it. The following characters are not allowed in the DNS hostnames, therefore you should not use them in NetBIOS names. Yes, if you use these characters you may get away by using them on LAN, but your computer won’t be able to communicate on the Internet.

  • comma (,)
  • tilde (~)
  • colon (:)
  • exclamation point (!)
  • at sign (@)
  • number sign (#)
  • dollar sign ($)
  • percent (%)
  • caret (^)
  • ampersand (&)
  • apostrophe (‘)
  • period (.)
  • parentheses (())
  • braces ({})
  • underscore (_)
  • white space (blank)

Other Considerations for NetBIOS Names

Here are some additional notes regarding the NetBIOS names.

  • The first character in a NetBIOS name must be alphabetic or numerical, not a special character.
  • Although numbers are allowed, you can’t have a NetBIOS name that only contains number (e.g. 1234567) due to a DNS restriction.
  • The last character cannot be a minus sign or a period.
  • You cannot use any of the 2-character Security Descriptor Definition Language (SDDL) user strings listed in well-known SIDs list. According to Microsoft, it will make import”, “export” and “take control” operations fail. Consider this a banned list of NetBIOS names so don’t use a computer name AU, CA CO, etc.
BEST PRACTICE: I recommend you only use letters A-Z and numbers 0-9. Do not use a period, underscore, or a hyphen in a NetBIOS name.

Don’t Mess with the Hostname

To view the hostname, go to the Command Prompt and type hostname. In the old days, changing the hostname was just as simple as changing the computer name. However, to discourage you from changing the hostname in the newer versions of Windows servers and clients, Microsoft has justifiably made it very difficult to change the hostname. When you are troubleshooting networking problems with Active Directory, SharePoint, SQL Server, and other products and can’t figure out the cause of the problem, I recommend you make sure that your servers have the same computer name and hostname. In the past 20 years, I have run into 2 or 3 clients who had changed the hostname and were having all sorts of networking issues.

BEST PRACTICE: Unless you have a valid reason, avoid changing the hostname of your computer.

How to View or Change the Computer Name

You can view the current computer name, or rename the computer, in Control Panel. Press Windows key + Pause/Break key and you will see the computer name listed in the Computer name, domain, and workgroup settings section. To change the computer name, click Change settings link in the right-hand side. Select the Change button, and in the Computer name box type the new name for your computer. Click OK and then restart your computer. This is the method I prefer for changing a computer name.

You can also change the computer name by using Windows Settings. In the Windows search box type computer name and select View your PC name. You will be taken to the Settings, where you will see your computer’s name under Device name in the the Device specifications section. You can use Rename this PC button to change the name of the computer and then restart the computer.

In addition, you can also use the command prompt to change the computer name. Start the command prompt as an administrator and use the following command:

WMIC ComputerSystem where Name=ComputerName call Rename NewName

For example,  to rename JUPITER to NEPTUNE, type:

WMIC ComputerSystem where Name=JUPITER call Rename NEPTUNE

You won’t see a prompt, but you must restart the computer.

BEST PRACTICE: Whenever you rename your computer restart the computer right away before you do anything else. This is a good habit to get into. I’ve seen a lot of problems with computers over the years that are not restarted right away after renaming the computer or installing new software updates.

NetBIOS Suffix Definitions

Here’s a table from Microsoft. I will add some additional content from Windows NT 4.0 Server Resource Kit later to this table when I get a chance.

Name NetBIOS Suffix Name Type Usage
<computer> 0x00 Unique Default name registered by a client computer. The Workstation Service, if enabled, registers this default name.
<machine group> 0x00 Group Browser clients and servers in <machine group>.
[01]

[02]

__MSBROWSE__[02]

[01]

0x01 Master browser. Note that the Name is a full 16 bytes, implicitly defining the NetBIOS suffix as 0x01.
<domain> 0x1B Domain master browser
<machine group> 0x1D Master browser
<machine group> 0x1E Browser service elections
<computer> 0x20 Default name registered by a server computer. The Server Service, if enabled, registers this default name.

Visit Microsoft’s website for information on Unique Names and Group Names.

I use to carry the NetBIOS suffix table in my pocket when I use to teach Windows NT courses in the 1990s. As an Ethical Hacker, I still find this table very useful because I can find out a whole lot of information about a network from this table. In fact, there are some security considerations that Microsoft has discussed here.

Summary of Best Practices

Here’s a summary of my best practices.

  • To be on the safe side, only use letters and numbers in a NetBIOS name.

In addition, DO NOT use:

  • A period in a NetBIOS name, even if you are able to.
  • An underscore in a NetBIOS name, even though it’s permitted.
  • A hyphen in a NetBIOS name, even though it’s permitted.***
  • Only numbers in a NetBIOS name because, although allowed, DNS doesn’t allow all numbers in a hostname (you already know now that a hostname is the same as NetBIOS name by default).
  • Any of the 2-character SDDL user strings listed in well-known SIDs list. Consider this a banned list of NetBIOS names so avoid them.

***There are those who will argue that hyphen is allowed in NetBIOS names and hostnames so it should be okay to use it. That’s what I used to think, but then I discovered that certain applications (that use hyphen as a flag)  will break things on the network. So based on my experience I recommend you stick to my advice and avoid period, underscore, and hyphen or else one day you may end up with a huge problem on your network that won’t be easy to troubleshoot. Hopefully this article at least gives you a clue that if things are really weird on your network and your consultants cannot figure out what’s going on then take a look at your NetBIOS and hostnames on your computers……both clients and servers.

Thanks for reading my article. If you are interested in IT training & consulting services, please reach out to me. Visit ZubairAlexander.com for information on my professional background.

Copyright © 2019 SeattlePro Enterprises, LLC. All rights reserved.

  • Facebook
  • Twitter
  • Linkedin

1 Comments

  1. An illuminating article, thanks for publishing it! I find it amusing that you so strongly advise against using hyphens in a computer name, yet Microsoft automatically names Windows systems using a hyphen!
    What were they thinking?!

Leave a Comment

Your email address will not be published. Required fields are marked *

This div height required for enabling the sticky sidebar