Codeberg/Community
54
324
Fork
You've already forked Community
12

Pages with custom domains #2292

Closed
opened 2026年01月05日 18:39:14 +01:00 by Flohw · 3 comments

Comment

Hi,

I set up a repository (https://codeberg.org/litchu/portfolio) and I think I setup my DNS properly (at Infomaniak) to get a custom domain. I checked that the site worked properly before adding the .domains file on portfolio.litchu.codeberg.page and it does.
I configured the domain with the third method on the documentation as Infomaniak does not let me add a CNAME for lise-zarcos.fr (it will for www.lise-zarcos.fr)

I now have the error 424 "could not find target for custom domain" which I don't understand fully... Plus the certificate is not generated properly... I tried multiple configurations and changes but as it's DNS, I am not sure if it's due to delay or my configuration... I found some other related issues but none of them gave me a clue about what I could have done wrong...

I hope someone could help me to understand what's going on...

Thank you

### Comment Hi, I set up a repository (https://codeberg.org/litchu/portfolio) and I think I setup my DNS properly (at Infomaniak) to get a custom domain. I checked that the site worked properly before adding the `.domains` file on portfolio.litchu.codeberg.page and it does. I configured the domain with the [third method on the documentation](https://docs.codeberg.org/codeberg-pages/using-custom-domain/#option-3%3A-a%2Faaaa-record) as Infomaniak does not let me add a CNAME for lise-zarcos.fr (it will for www.lise-zarcos.fr) I now have the error 424 "could not find target for custom domain" which I don't understand fully... Plus the certificate is not generated properly... I tried multiple configurations and changes but as it's DNS, I am not sure if it's due to delay or my configuration... I found some other related issues but none of them gave me a clue about what I could have done wrong... I hope someone could help me to understand what's going on... Thank you
Author
Copy link

Well, I switched to the pages default repository and it worked as expected.

I am almost sure I could configure a "subsub"domain somewhere but I may have misunderstood something or maybe I found a bug ? ^^ If I can get some info about that...

Thank you

Well, I switched to the `pages` default repository and it worked as expected. I am almost sure I could configure a "subsub"domain somewhere but I may have misunderstood something or maybe I found a bug ? ^^ If I can get some info about that... Thank you
Member
Copy link

@Flohw wrote in #2292 (comment):

Well, I switched to the pages default repository and it worked as expected.

I am almost sure I could configure a "subsub"domain somewhere but I may have misunderstood something or maybe I found a bug ? ^^ If I can get some info about that...

Thank you

You can, but you must use the pages branch of any other repo by default. You also must specify the repo's name in your CNAME/TXT record(s).

For example, if you wanted to serve the pages branch from a repo called coolproject in your own account, your CNAME record would need to point to coolproject.flohw.codeberg.page.

If you wanted to serve a branch called web from the same repo, your CNAME record would need to point to web.coolproject.flohw.codeberg.page.

Getting the DNS configuration right can be kinda tricky. A couple years ago I made a bash script that checks the configuration of your domain and attempts to tell you how to fix it. If you want to give it a shot, make sure dnsutils is installed on your computer and use this command: curl https://troubleshoot.codeberg.page/verify.sh | bash -s <custom-domain>

For the record, I tried running the script on your domains and it said the apex domain is configured correctly (for the default pages repo) but your www subdomain doesn't have any records.

@Flohw wrote in https://codeberg.org/Codeberg/Community/issues/2292#issuecomment-9567368: > Well, I switched to the `pages` default repository and it worked as expected. > > I am almost sure I could configure a "subsub"domain somewhere but I may have misunderstood something or maybe I found a bug ? ^^ If I can get some info about that... > > Thank you You can, but you must use the `pages` branch of any other repo by default. You also must specify the repo's name in your CNAME/TXT record(s). For example, if you wanted to serve the `pages` branch from a repo called _coolproject_ in your own account, your CNAME record would need to point to `coolproject.flohw.codeberg.page.` If you wanted to serve a branch called `web` from the same repo, your CNAME record would need to point to `web.coolproject.flohw.codeberg.page.` Getting the DNS configuration right can be kinda tricky. A couple years ago I made a bash script that checks the configuration of your domain and attempts to tell you how to fix it. If you want to give it a shot, make sure `dnsutils` is installed on your computer and use this command: `curl https://troubleshoot.codeberg.page/verify.sh | bash -s <custom-domain>` For the record, I tried running the script on your domains and it said the apex domain is configured correctly (for the default pages repo) but your `www` subdomain doesn't have any records.
Author
Copy link

The branch... I forgot about the branch... I thought it always was the repository's default branch unless specified otherwise...

I will try to think a bit about that again.

Thank you for your comment and your script, I will look into it.

The branch... I forgot about the branch... I thought it always was the repository's default branch unless specified otherwise... I will try to think a bit about that again. Thank you for your comment and your script, I will look into it.
Sign in to join this conversation.
No Branch/Tag specified
main
No results found.
Labels
Clear labels
accessibility

Reduces accessibility and is thus a "bug" for certain user groups on Codeberg.
bug

Something is not working the way it should. Does not concern outages.
bug
infrastructure

Errors evidently caused by infrastructure malfunctions or outages
Codeberg

This issue involves Codeberg's downstream modifications and settings and/or Codeberg's structures.
contributions welcome

Please join the discussion and consider contributing a PR!
docs

No bug, but an improvement to the docs or UI description will help
duplicate

This issue or pull request already exists
enhancement

New feature
infrastructure

Involves changes to the server setups, use `bug/infrastructure` for infrastructure-related user errors.
legal

An issue directly involving legal compliance
licence / ToS

involving questions about the ToS, especially licencing compliance
please chill
we are volunteers

Please consider editing your posts and remember that there is a human on the other side. We get that you are frustrated, but it's harder for us to help you this way.
public relations

Things related to Codeberg's external communication
question

More information is needed
question
user support

This issue contains a clearly stated problem. However, it is not clear whether we have to fix anything on Codeberg's end, but we're helping them fix it and/or find the cause.
s/Forgejo

Related to Forgejo. Please also check Forgejo's issue tracker.
s/Forgejo/migration

Migration related issues in Forgejo
s/Pages

Issues related to the Codeberg Pages feature
s/Weblate

Issue is related to the Weblate instance at https://translate.codeberg.org
s/Woodpecker

Woodpecker CI related issue
security

involves improvements to the sites security
service

Add a new service to the Codeberg ecosystem (instead of implementing into Gitea)
upstream

An open issue or pull request to an upstream repository to fix this issue (partially or completely) exists (i.e. Gitea, Forgejo, etc.)
wontfix

Codeberg's current set of contributors are not planning to spend time on delegating this issue.
Milestone
Clear milestone
No items
No milestone
Projects
Clear projects
No items
No project
Assignees
Clear assignees
No assignees
2 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
Codeberg/Community#2292
Reference in a new issue
Codeberg/Community
No description provided.
Delete branch "%!s()"

Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?