The SF came up with the validation message "Domain is not used". After deleting the domain I found out that some functionalities were giving an error message because the domain was using in a declare.
To have the validation perform a code search on the domain name is probably very difficult (because a domain name in a code template can be anything) but feel free to make it so if possible.
I would at least suggest that the validation Description, Consequence or Solution text be expanded to alert a developer that performing a code search on this domain name is a required action before deleting the domain.
