It would be a lot of hassle, from what I've heard at least. Personally, I haven't done this, so I can't say I know much but if you want to find out more you can go to https://pi-hole.net/
Mojang should hire me. My one and only skill is deleting all of Minecraft's code, disbanding Mojang, and replacing minecraft.net with a redirect to terraria.org. I think I could really simplify mob grinders and increase game quality by about 400%.
But...
This video is sponsored by NordVPN. Staying safe online is an ever growing difficulty and you could be exploited by Minecraft. NordVPN allows you to change your IP address, making you harder to track, securing your privacy. Use the code StopMCFromFindingMe to get 20% off for the first two months and thank you to NordVPN for sponsoring this video.