Since ip address is fairly easy to get from a domain name (there is probably more programs that can do it than I can count), I don't that has anything to do with being secure. After all a domain name is just a set of letters that are "aliased" to an ip address so it's easier for a user to type
linuxquestions.org to their browsers -- and rememer -- than always type an ip address. People usually like to use names instead of long series of numbers. And one aspect of domain names is what the name tells to a person: if one wants to find information about, say, Linux, the person is more probable to try out
http://www.linux.org (or .org or .com or something), than just guess something like
http://83.38.72.27. I really doubt if it has got anything to do with security, having or not having a domain name, since if somebody would like to write a bot that searched specific kind of machines from the web, it would create no problems getting the ip address from the domainname -- and after all, ip address is just an address of a machine on the net, it doesn't reveal any information about the machine being secure or not.