If the Server Name has a space.... HOSTS file help


Recommended Posts

When I originally built my first Unraid I made the critical mistake of making the server name two words with a space. Talk about good practice coming back to bite you!

 

As such I would like to know if it is possible to access the Unraid Main Menu with a server name that is two words (inc. space), rather than just the IP. Can it be typed in and what is the format?

 

I hope that upon learning how it can be accessed as a two word server name with a space that I can then edit that format into my hosts file to simplify things.

 

Any ideas?

 

-Alex

Link to comment

You are using an invalid hostname.

Since many files use a space or tab as a delimiter it's going to give you grief all the time.

You can make an alias which points to the hostname while you transition. (and I do recommend you change it).

 

So you can have both a hostname as you have now and one without the spaces all defined to the same IP if needed.

 

 

Restrictions on valid host names

Hostnames are composed of series of labels concatenated with dots, as are all domain names. For example, "en.wikipedia.org" is a hostname. Each label must be between 1 and 63 characters long,[1] and the entire hostname (including the delimiting dots) has a maximum of 255 characters.

 

The Internet standards (Request for Comments) for protocols mandate that component hostname labels may contain only the ASCII letters 'a' through 'z' (in a case-insensitive manner), the digits '0' through '9', and the hyphen ('-'). The original specification of hostnames in RFC 952, mandated that labels could not start with a digit or with a hyphen, and must not end with a hyphen. However, a subsequent specification (RFC 1123) permitted hostname labels to start with digits. No other symbols, punctuation characters, or white space are permitted.

 

While a hostname may not contain other characters, such as the underscore character (_), other DNS names may contain the underscore.[2] Systems such as DomainKeys and service records use the underscore as a means to assure that their special character is not confused with hostnames. For example, _http._sctp.www.example.com specifies a service pointer for an SCTP capable webserver host (www) in the domain example.com.

 

A notable example of non-compliance with this specification, Microsoft Windows systems often use underscores in hostnames. Since some systems will reject invalid hostnames while others will not, the use of invalid hostname characters may cause subtle problems in systems that connect to standards-based services. For example, RFC-compliant mail servers will refuse to deliver mail for MS Windows computers with names containing underscores. Android smartphones also use underscores in their hostnames.

Link to comment

I was in the middle of typing that you really need to change your host name and lost my post..

 

for a servers network host name, you only want to  use a-z and 1-0. (in most cases, a dash is ok)

 

underscores can screw with some dns servers. even though Microsoft like underscores, I would avoid it. even in an all windows network (if there is  such a thing), the second you attach some appliances or server that are not Microsoft, they can have issues.

 

Spaces in a network/servername cause major grief, some apps that all unc paths will blow-up with a space in the name. in addition, dns usually truncates the name in the database and then you cant find the server.

 

you should keep your server names to 15 characters or less. although AD can support 16byte names, some devices are still old school..

 

also you should not name a server anything that can translate in hex.. some servers or network appliances might think that is in hex and then cause issues..

 

 

 

 

 

Link to comment

Wow, it is always a pleasure having such knowledgeable individuals willing to provide such answers. Thank you. I feel I have learnt a trick or two this afternoon.

 

You can make an alias which points to the hostname while you transition. (and I do recommend you change it).

 

So you can have both a hostname as you have now and one without the spaces all defined to the same IP if needed.

 

 

 

 

 

WeeboTech - As an interim measure how would I establish such an alias to the same IP, so that both are accessible. I am at a loss as to what the process may be called to do a search.  Any insight to point me in the right direction?

 

 

 

 

Link to comment

Wow, it is always a pleasure having such knowledgeable individuals willing to provide such answers. Thank you. I feel I have learnt a trick or two this afternoon.

 

You can make an alias which points to the hostname while you transition. (and I do recommend you change it).

 

So you can have both a hostname as you have now and one without the spaces all defined to the same IP if needed.

WeeboTech - As an interim measure how would I establish such an alias to the same IP, so that both are accessible. I am at a loss as to what the process may be called to do a search.  Any insight to point me in the right direction?

 

How is your network set up?

Do you have a DNS server or something defined in a router that provides hostname resolution?

That's where you would define two hosts one to an ip, then an alias to the other one.

 

Other then that I suppose you could update the local hosts file.

I'm sorta baffled in how you were able to use a hostname with a space in it to begin with.

Link to comment

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.