Only accepting connections by the domain

Hello, I have a question, is it possible for the server to accept only connections to the cloudflare domain and reject connections via numeric ip? (e.g. with the TS3 server through the domain it will connect and when he enters the numeric server ip it will reject it)