Using domain names in your topology file is really more for convenience. There is no security risk so long as you have properly configured your firewall. Though it is definitely a good idea to only have your block producer IP address known to hosts on your internal network.
For example, you can run your own caching nameserver on your internal network, with specific extra configuration for your own domain names. So long as you firewall this from outside, then only your internal network hosts can access this nameserver. If you want to do this, I would recommend unbound but you will need to ensure this is firewalled correctly.
Although it is more work, I think it is generally a good idea to run your own caching nameserver because then you are not relying on your ISP (or some other namserver you don’t control) to tell you the truth about IP addresses. A caching nameserver does it’s own DNS lookups by starting at the root name servers and working down to the name you seek. It then caches the results so that other machines on your network will get a near instant result if they lookup the same name. This can greatly speed up name resolutions on your internal network and overall reduce network bandwith usage. In other words, running your own caching nameserver can provide security, speed, and bandwith benefits.
If you like the idea of running your own nameserver internally, then there are other useful things you can do with it. For example you can configure your nameserver to return the loopback address for every advertising domain name. This is a great ad blocker feature which causes every host on your network to not even contact advertisers websites because every time they look up their domain names they get 127.0.0.1 returned which causes them to contact themselves resulting in an instant rejection. Thus saving both network traffic and disabling the advertisers ability to track you. For more information about this see: https://pgl.yoyo.org/
If anyone is interested in using the caching nameserver unbound as an ad blocker this way, I can provide more information and some simple scripts on how to do it.