# Domain name contains invalid character

**URL:** <https://community.letsencrypt.org/t/domain-name-contains-invalid-character/180724>\
**Category:** Help\
**Created:** [July 5, 2022, 8:57pm UTC](https://community.letsencrypt.org/t/domain-name-contains-invalid-character/180724 "2022-07-05T20:57:46Z")\
**Posts on this page:** 13\
**Page:** 1

<div class="post-metadata">

**Author:** ![Pinnokkio](https://sea3.discourse-cdn.com/letsencrypt/user_avatar/community.letsencrypt.org/pinnokkio/32/62031_2.png) [@Pinnokkio](https://community.letsencrypt.org/u/Pinnokkio)\
**Post date:** [July 5, 2022, 8:57pm UTC](https://community.letsencrypt.org/t/domain-name-contains-invalid-character/180724/1 "2022-07-05T20:57:46Z")

</div>

It produced this output:

```nohighlight

**'_.mydm.li'**
Invalid response from https://acme-v02.api.letsencrypt.org/acme/new-order.
Details:
Type: urn:ietf:params:acme:error:rejectedIdentifier
Status: 400
Detail: Error creating new order :: Cannot issue for "_.mydm.li": Domain name contains an invalid characters

```

The operating system my web server runs on is (include version):  
CentOS 7.9.2009

My hosting provider, if applicable, is:  
DomainFactory (server belongs to GoDaddy as far as I know)

I can login to a root shell on my machine (yes or no, or I don't know):  
Yes

I'm using a control panel to manage my site (no, or provide the name and version of the control panel):  
Plesk Obsidian v18.0.44\_build1800220614.18 os\_CentOS 7

Hey,

in november 2021, I decided to switch from a shared webhosting server to a virtual server. I’ve configured the whole system using Plesk Obsidian, everything worked except adding specific let‘s encrypt certificates.

Plesk allowes me to add wildcard-domains like „\*.mydm.li“ which acting like a catch-all-domain.  
Unfortunately, I couldn‘t create a certificate for this domain. It‘s only a problem for me because Plesk sends me an email every day which is annoying and couldn‘t be disabled for some reason:

```nohighlight

Could not secure domains of admin (login admin) with Let`s Encrypt certificates. Please log in to Plesk and secure the domains listed below manually.
Securing of the following domains has failed:

**'_.mydm.li'**
Invalid response from https://acme-v02.api.letsencrypt.org/acme/new-order.
Details:
Type: urn:ietf:params:acme:error:rejectedIdentifier
Status: 400
Detail: Error creating new order :: Cannot issue for "_.mydm.li": Domain name contains an invalid character

The following domains have been secured without some of their Subject Alternative Names:

<none>

Could not renew Let`s Encrypt certificates for admin (login admin). Please log in to Plesk and renew the certificates listed below manually.
Renewal of the following Let`s Encrypt certificates has failed:

<none>

The following Let`s Encrypt certificates have been renewed without some of their Subject Alternative Names:

<none>

Legend:
[+] This domain is secure. The domain's SSL/TLS certificate from Let`s Encrypt has been issued/renewed.
[-] This domain is not secure. Either the domain's SSL/TLS certificate from Let`s Encrypt could not be issued/renewed or the domain name was excluded from the certificate. Renew the certificate manually or request a new one to secure this domain.

```

I also don‘t know why it says „\_.mydm.li“ instead of a \*.

I tried to contact my hoster but they rejected any help because the server is managed by myself only. Instead, they recommended to ask on this forums. I‘m also not really good in using terminal commands.

I really appreciate your help,  
Thank you!

---

<div class="post-metadata">

**Author:** ![rg305](https://sea3.discourse-cdn.com/letsencrypt/user_avatar/community.letsencrypt.org/rg305/32/91314_2.png) [@rg305](https://community.letsencrypt.org/u/rg305)\
**Post date:** [July 5, 2022, 9:00pm UTC](https://community.letsencrypt.org/t/domain-name-contains-invalid-character/180724/2 "2022-07-05T21:00:01Z")

</div>

Hi @Pinnokkio, and welcome to the LE community forum 🙂

It seems that Plesk has found a site named "`_.mydm.li`" and is trying to obtain a cert for it.  
I'd search through to find that site and give it a proper name.

---

<div class="post-metadata">

**Author:** ![Pinnokkio](https://sea3.discourse-cdn.com/letsencrypt/user_avatar/community.letsencrypt.org/pinnokkio/32/62031_2.png) [@Pinnokkio](https://community.letsencrypt.org/u/Pinnokkio)\
**Post date:** [July 6, 2022, 5:13am UTC](https://community.letsencrypt.org/t/domain-name-contains-invalid-character/180724/3 "2022-07-06T05:13:44Z")

</div>

Thanks.

What do you exactly mean by giving a proper name?

"mydm.li" is just a placeholder, I have source domains with the same problem.

---

<div class="post-metadata">

**Author:** ![MikeMcQ](https://sea3.discourse-cdn.com/letsencrypt/user_avatar/community.letsencrypt.org/mikemcq/32/52772_2.png) [@MikeMcQ](https://community.letsencrypt.org/u/MikeMcQ)\
**Post date:** [July 6, 2022, 1:13pm UTC](https://community.letsencrypt.org/t/domain-name-contains-invalid-character/180724/4 "2022-07-06T13:13:21Z")

</div>

> [@Pinnokkio](#):
>
> `Detail: Error creating new order :: Cannot issue for "_.mydm.li": Domain name contains an invalid characters`

The error isn't for the name `mydm.li` it is for that with a leading underscore. That is not a valid domain name. So, as rg305 suggested, you should look for why Plesk tries that name and remove it. You cannot get a cert for an invalid domain name.

If you cannot find why Plesk does that you should contact Plesk forum or your hosting service.

---

<div class="post-metadata">

**Author:** ![jvanasco](https://sea3.discourse-cdn.com/letsencrypt/user_avatar/community.letsencrypt.org/jvanasco/32/55900_2.png) [@jvanasco](https://community.letsencrypt.org/u/jvanasco)\
**Post date:** [July 6, 2022, 2:04pm UTC](https://community.letsencrypt.org/t/domain-name-contains-invalid-character/180724/5 "2022-07-06T14:04:15Z")

</div>

> [@MikeMcQ](#):
>
> That is not a valid domain name.

Specifically, underscores are not valid characters in a domain name. Domain Names (including subdomains) may only contain (i) letters a-z, (2) numbers 0-9, (3) hyphens (which may not be used consecutively or be the first or last character).

---

<div class="post-metadata">

**Author:** ![rmbolger](https://sea3.discourse-cdn.com/letsencrypt/user_avatar/community.letsencrypt.org/rmbolger/32/27474_2.png) [@rmbolger](https://community.letsencrypt.org/u/rmbolger)\
**Post date:** [July 6, 2022, 2:50pm UTC](https://community.letsencrypt.org/t/domain-name-contains-invalid-character/180724/6 "2022-07-06T14:50:38Z")

</div>

> [@jvanasco](#):
>
> Specifically, underscores are not valid characters in a domain name. Domain Names (including subdomains) may only contain (i) letters a-z, (2) numbers 0-9, (3) hyphens (which may not be used consecutively or be the first or last character).

Not sure if you're distinguishing a "domain name" from any old DNS FQDN here, but millions of Active Directory domains with SRV records such as `_ldap._tcp.example.com` would like to disagree with you...not to mention `_acme-challenge.example.com`.

I even just created a `_.example.com` zone in my lab environment on Infoblox with a `_acme-challenge._.example.com` TXT record within it. No issues.

---

<div class="post-metadata">

**Author:** ![MikeMcQ](https://sea3.discourse-cdn.com/letsencrypt/user_avatar/community.letsencrypt.org/mikemcq/32/52772_2.png) [@MikeMcQ](https://community.letsencrypt.org/u/MikeMcQ)\
**Post date:** [July 6, 2022, 3:08pm UTC](https://community.letsencrypt.org/t/domain-name-contains-invalid-character/180724/7 "2022-07-06T15:08:52Z")

</div>

Excellent point @rmbolger .

Here is an (old) post that addresses the restrictions for Let's Encrypt. These restrictions are for names in certs as dictated by the Baseline Requirements

> [@Underscore in subdomain fails](https://community.letsencrypt.org/t/underscore-in-subdomain-fails/31431):
>
> P…

---

<div class="post-metadata">

**Author:** ![barf7709](https://sea3.discourse-cdn.com/letsencrypt/user_avatar/community.letsencrypt.org/barf7709/32/61928_2.png) [@barf7709](https://community.letsencrypt.org/u/barf7709)\
**Post date:** [July 6, 2022, 3:10pm UTC](https://community.letsencrypt.org/t/domain-name-contains-invalid-character/180724/8 "2022-07-06T15:10:27Z")

</div>

> **[Domain name | Domain name syntax](https://en.wikipedia.org/wiki/Domain_name#Domain_name_syntax)**
>
> A domain name consists of one or more parts, technically called labels, that are conventionally concatenated, and delimited by dots, such as example.com.
> 1.The right-most label conveys the top-level domain; for example, the domain name www.example.com belongs to the top-level domain com. |
> 2.The hierarchy of domains descends from the right to the left label in the name; each label to the left specifies a subdivision, or subdomain of the domain to the right. For example: the label example specif...

Please see the above link to Wikipedia on Domain name, the syntax and size of each component of a FQDN is described.

---

<div class="post-metadata">

**Author:** ![Bruce5051](https://sea3.discourse-cdn.com/letsencrypt/user_avatar/community.letsencrypt.org/bruce5051/32/76576_2.png) [@Bruce5051](https://community.letsencrypt.org/u/Bruce5051)\
**Post date:** [July 6, 2022, 3:18pm UTC](https://community.letsencrypt.org/t/domain-name-contains-invalid-character/180724/9 "2022-07-06T15:18:38Z")

</div>

Also from here: [RFC 1034 - Domain names - concepts and facilities](https://datatracker.ietf.org/doc/html/rfc1034#section-3.5) and [RFC 1035 - Domain names - implementation and specification](https://datatracker.ietf.org/doc/html/rfc1035#section-2.3.1)

There is no **underscore** (i.e **\_** ).

```nohighlight
<domain> ::= <subdomain> | " "

<subdomain> ::= <label> | <subdomain> "." <label>

<label> ::= <letter> [[ <ldh-str>] <let-dig> ]

<ldh-str> ::= <let-dig-hyp> | <let-dig-hyp> <ldh-str>

<let-dig-hyp> ::= <let-dig> | "-"

<let-dig> ::= <letter> | <digit>

<letter> ::= any one of the 52 alphabetic characters A through Z in
upper case and a through z in lower case

<digit> ::= any one of the ten digits 0 through 9

```

---

<div class="post-metadata">

**Author:** ![jvanasco](https://sea3.discourse-cdn.com/letsencrypt/user_avatar/community.letsencrypt.org/jvanasco/32/55900_2.png) [@jvanasco](https://community.letsencrypt.org/u/jvanasco)\
**Post date:** [July 6, 2022, 3:36pm UTC](https://community.letsencrypt.org/t/domain-name-contains-invalid-character/180724/10 "2022-07-06T15:36:14Z")

</div>

> [@rmbolger](#):
>
> Not sure if you're distinguishing a "domain name" from any old DNS FQDN here,

I should have said "Host Name" to be more clear. You can stuff a leading underscore - and pretty much anything else - into general DNS records as of RFC 2181. (I do not believe they are allowed in A records, but TXT and CNAME are supported). A Domain Name record that is used to map a host/internet address, however, must comply with the requirements above (via RFC 1035). The leading underscore syntax was developed to differentiate control/information records and service pointers in DNS from actual host names.

Once upon a time, it was valid to issue certificates and run services on domains with leading underscores. The CA/B forum barred issuance of certificates for those domains a while back, and most servers/browsers will now generate errors if you try to run a service on a host name with a leading underscore.

---

<div class="post-metadata">

**Author:** ![rmbolger](https://sea3.discourse-cdn.com/letsencrypt/user_avatar/community.letsencrypt.org/rmbolger/32/27474_2.png) [@rmbolger](https://community.letsencrypt.org/u/rmbolger)\
**Post date:** [July 6, 2022, 3:38pm UTC](https://community.letsencrypt.org/t/domain-name-contains-invalid-character/180724/11 "2022-07-06T15:38:14Z")

</div>

I also didn't realize the distinction between "works in general for DNS resolution" and "allowed for use in a certificate". Good to be reminded of these esoteric things on occasion.

---

<div class="post-metadata">

**Author:** ![Bruce5051](https://sea3.discourse-cdn.com/letsencrypt/user_avatar/community.letsencrypt.org/bruce5051/32/76576_2.png) [@Bruce5051](https://community.letsencrypt.org/u/Bruce5051)\
**Post date:** [July 6, 2022, 3:42pm UTC](https://community.letsencrypt.org/t/domain-name-contains-invalid-character/180724/12 "2022-07-06T15:42:07Z")

</div>

> [@Bruce5051](#):
>
> `<label> ::= <letter> [[<ldh-str>] <let-dig> ]`

Yeah, this is the sneaky one people have to watch out for.

---

<div class="post-metadata">

**Author:** ![system](https://global.discourse-cdn.com/letsencrypt/original/3X/c/a/ca6c06ea1ea201324bba7048c6841ce60236468d.png) [@system](https://community.letsencrypt.org/u/system)\
**Post date:** [August 5, 2022, 3:42pm UTC](https://community.letsencrypt.org/t/domain-name-contains-invalid-character/180724/13 "2022-08-05T15:42:11Z")

</div>

Closed on August 5, 2022, 3:42pm UTC

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.
