Redirect from ip to "hostname.domain.com"

Hello. Has anyone encountered the problem of redirecting an https request from ip to “gitlab.example.com” with a deployed DNS server? Share your knowledge, please.