Local or private ip

And how is possible to define a fake domain name e.g. example.com on a localhost? And does gethostbyaddr() returns the private ip associated with that domain on local host?