function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Christian Peter 2Christian Peter 2 

"System.CalloutException: Illegal given domain name" to subdomain with underscore


I'm using Name Credential to do callouts. Starting today, I'm getting an "invalid domain name" exception on domains which do contain an underscore.

For demo purposes I'm going to use a domain which a found while googleling for another domain contaning an underscore "" to verify it has nothing to do with my employers network infrastructure.

Demo code:
HttpRequest req = new HttpRequest();      

req.setHeader('Content-Type', 'application/json');

Http http = new Http();
HTTPResponse res = http.send(req);
System.debug('res: '+ res);

Name Credential URL:

Any other domain not containing an underscore works like a charm.

Does anyone have a hint?

As a workaround, we are trying to migrate to non-underscore subdomains and avoid them in the future.
Steven LawranceSteven Lawrance
Thanks for asking about that. Fortunately, it should be possible to get it working by replacing the underscore characters with hyphens. As an example, appears to resolve to the same target as in DNS.