I'm writing some bash on a linux server, and there's one concept I'm trying to get my head around.
Given a domain name, can I tell if it's pointing to the current server? Bearing in mind that the server may have multiple ip addresses.
My current plan is to loop all ip addresses from the 'ip addr' command, and see if the 'host example.com' returns one of them.
Any better ideas?