Here few lines from the Xerver(1) man page.
The X server also uses a host-based access control list for deciding
whether or not to accept connections from clients on a particular
machine. If no other authorization mechanism is being used, this list
initially consists of the host on which the server is running as well
as any machines listed in the file /etc/Xn.hosts, where n is the dis-
play number of the server. Each line of the file should contain either
an Internet hostname (e.g. expo.lcs.mit.edu) or a DECnet hostname in
double colon format (e.g. hydra:
. There should be no leading or
trailing spaces on any lines. For example:
joesworkstation
corporate.company.com
star::
bigcpu::
Users can add or remove hosts from this list and enable or disable
access control using the xhost command from the same machine as the
server.