Hostname can contain only lowercase letters, numbers, dashes and dots according to RFC921, RFC952 and RFC1123

Problem:
When I want to create a Host via GUI/API I get :
“hostname can contain only lowercase letters, numbers, dashes and dots according to RFC921, RFC952 and RFC1123”

My hostname is: aa.bb-cc.dd-04

I dont know why I get that Error.

Can anyone help me.
I can see it here as a Bug, it should be solved in 2.4.0 but its still there
https://wiki.theforeman.org/issues/31645

Foreman and Proxy versions:
version: 2.4.0

Thanks in advance

Regards

Neeloj

or when I create it like this: nl.arnhem.xy-z.hostname
I get: must not include periods

Generally the first part before the first dot is the plain hostname and the everything after that is the dotted domain name. So your hostname looks reversed. It should be hostname.xy-z.arnhem.nl. You should create a domain xy-z.arnhem.nl in foreman and then assign it to your new host with name “hostname”.

1 Like

Thanks for you answer @gvde , you are right.

But I have many hosts from other technology which I want create the hosts for them in foreman.

The format is like what I send.

And they have different domains that’s the problem. So I cannot cover all of them
Like that.

But why I cannot create Hostname like what they suggest letter(small), number, dashes and dots.

Thank you again.

You cannot simply use a different fqdn hostname format. It’s defined in the rfcs mentioned. The dot separates the domain part. It’s not part of the hostname itself. It belongs to the fqdn hostname.

1 Like

it’s possible to have dashes/underscores in the hostname?

In this way I can replace them in my code.

So that will help me a little bit better.

I think you push me in right way :blush:

Thanks @gvde

As the error messages and the rfcs say: lowercase letters, numbers, dashes.

1 Like

So I’ll replace them with dashes that’s Dienst matter for me.

And I can also cut the host- domain name and create the hosts in my code…

Thank you so much :slight_smile: