Gitlab Pages custom DNS to root domain while Gitlab pointed to one of it's subdomain

Hi,

I would like to be able to point gitlab pages to root domain, while my gitlab pointed to one of it’s subdomain. How can I configure DNS record for that? The documentation said that I have to use A record.

I’ve tried :
A gitlab.domain.com XX.XX.XX.XX
A domain.com XX.XX.XX.XX
A www XX.XX.XX.XX

But going to domain.com will always redirect me to gitlab.domain.com

So the goal is :

  1. Gitlab in gitlab.domain.com
  2. one Gitlab Pages custom DNS in domain.com (while it is actually in namespace.domain.com)
  3. another gitlab pages without custom DNS in namespace.domain.com

Can anyone help me?
Thank you