sounds like you're talking about CORS. you can list domains that ajax is allowed to fetch using the "Access-Control-Allow-Origin" header.
there's also the document.domain property which tells you your current domain. If you had a list of domains, you would use document.domain to spot that domain in a lineup.
BROWSER STATS [% share]
(2013/10/31) IE7:0.5, IE8:8.6, IE9:5.3, IE10:12.3, FF:17.7, CH:41.8, SF:8.1, MOBILE:20.4