/me wonders if is makes sense, otherwise mysql/mariadb is started before dnsmasq is up and therefore a hostname in my.cnf might not be evaluated, or ?
If you need this, please adjust the setting in the /etc/conf.d/mysql. An example is provided there already.