Path: csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!feeder.erje.net!us.feeder.erje.net!news2.arglkargh.de!news.swapon.de!fu-berlin.de!uni-berlin.de!individual.net!not-for-mail From: "Peter H. Coffin" Newsgroups: comp.lang.php Subject: Re: [ Get Hostname ] Date: Mon, 18 May 2015 09:53:27 -0500 Lines: 46 Message-ID: References: <55599B49.7050802@arnowelzel.de> <55599D06.7080208@arnowelzel.de> <1865910.lMKXOGlSMj@PointedEars.de> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Trace: individual.net oDwk/U+aBtIK5kSFgN3KCALxBJLEInRtjRdejeNpLqUlP40pS7 X-Orig-Path: nibelheim.ninehells.com!not-for-mail Cancel-Lock: sha1:zsL/mYgCrLyzAVpNjQ1ZpcGtbZY= User-Agent: slrn/0.9.9p1 (OpenBSD) Xref: csiph.com comp.lang.php:15339 On Mon, 18 May 2015 15:26:34 +0200, Thomas 'PointedEars' Lahn wrote: > Arno Welzel wrote: > >> Am 2015-05-18 um 09:56 schrieb Arno Welzel: >> >>> Am 2015-05-12 um 02:10 schrieb alissonlinneker@gmail.com: >>> >>>> How do I get file_get_contents return the client domain that is >>>> referring to the url? >>>> >>>> $ _SERVER ["REMOTE_ADDR"] is returning the shared hosting DNS >>>> reverse and not site.com >> >> [...] >> >> Sorry - I overlooked this part of your question. >> >> In fact this problem can not be solved as it is a very common usual >> way to host web sites - one IP address any many domains which resolve >> to this address but the host name of the provider for DNS reverse. > > Ex falso quodlibet. > > $_SERVER['REMOTE_ADDR'], as it is correctly written (no space > in-between, certainly not after “$”), is almost never “returning > the shared hosting DNS reverse”. It yields the external *IP address* > of the *client*, not the server. Usually that means that it is the > *dial-up* _IP address_ assigned by an ISP to the household of a > customer (or one of the customer’s machines with IPv6-only). Reverse > DNS lookup on that address *may* then yield the temporary hostname of > the client as assigned by the ISP. You missed the context entirely, Sparky. OP an API to other websites as a paid service. He wants to validate that requests hitting his API engine from from paying customers. He wanted to use the domain of the IP address, but has since learned that that unreliables and the recommendation of including a validation key/password as part of the API request may have to do has been floated. -- 48. I will treat any beast which I control through magic or technology with respect and kindness. Thus if the control is ever broken, it will not immediately come after me for revenge. --Peter Anspach's list of things to do as an Evil Overlord