I'd like to create a new user in mysql which will be able to connect only from my servers. I've seen a way to do it through IP ranges or domain names (e.g. CREATE USER 'repl'@'%.mydomain.com' IDENTIFIED BY 'slavepass'; )
Can I somehow (by changing hostnames, hosts files or such) define a domain of servers which talk to each other through this user, without involving a real DNS server?
If you want to use names instead of IPs, you can use a DNS server which will resolve the names to IPs. Alternatively, you need to include the used names in the hosts file of each machine you want to be able to resolve these names.
If you have many names/machines, setting up a local DNS server can be easier than maintaining a long list of names in many hosts files located on many machines.