Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.python > #17736 > unrolled thread
| Started by | Νικόλαος Κούρας <nikos.kouras@gmail.com> |
|---|---|
| First post | 2011-12-22 06:40 -0800 |
| Last post | 2012-01-02 11:54 -0800 |
| Articles | 5 on this page of 25 — 9 participants |
Back to article view | Back to comp.lang.python
socket.gethostbyaddr( os.environ['REMOTE_ADDR'] error Νικόλαος Κούρας <nikos.kouras@gmail.com> - 2011-12-22 06:40 -0800
Re: socket.gethostbyaddr( os.environ['REMOTE_ADDR'] error Rami Chowdhury <rami.chowdhury@gmail.com> - 2011-12-22 15:32 +0000
Re: socket.gethostbyaddr( os.environ['REMOTE_ADDR'] error Νικόλαος Κούρας <nikos.kouras@gmail.com> - 2011-12-22 08:29 -0800
Re: socket.gethostbyaddr( os.environ['REMOTE_ADDR'] error becky_lewis <bex.lewis@gmail.com> - 2011-12-23 02:41 -0800
Re: socket.gethostbyaddr( os.environ['REMOTE_ADDR'] error Νικόλαος Κούρας <nikos.kouras@gmail.com> - 2011-12-23 09:14 -0800
Re: socket.gethostbyaddr( os.environ['REMOTE_ADDR'] error Νικόλαος Κούρας <nikos.kouras@gmail.com> - 2012-01-02 05:25 -0800
Re: socket.gethostbyaddr( os.environ['REMOTE_ADDR'] error Heiko Wundram <modelnine@modelnine.org> - 2012-01-02 15:00 +0100
Re: socket.gethostbyaddr( os.environ['REMOTE_ADDR'] error Νικόλαος Κούρας <nikos.kouras@gmail.com> - 2012-01-02 07:29 -0800
Re: socket.gethostbyaddr( os.environ['REMOTE_ADDR'] error Roy Smith <roy@panix.com> - 2012-01-02 10:47 -0500
Re: socket.gethostbyaddr( os.environ['REMOTE_ADDR'] error Νικόλαος Κούρας <nikos.kouras@gmail.com> - 2012-01-02 10:17 -0800
Re: socket.gethostbyaddr( os.environ['REMOTE_ADDR'] error becky_lewis <bex.lewis@gmail.com> - 2011-12-22 07:52 -0800
Re: socket.gethostbyaddr( os.environ['REMOTE_ADDR'] error Thomas Rachel <nutznetz-0c1b6768-bfa9-48d5-a470-7603bd3aa915@spamschutz.glglgl.de> - 2012-01-02 16:49 +0100
Re: socket.gethostbyaddr( os.environ['REMOTE_ADDR'] error Νικόλαος Κούρας <nikos.kouras@gmail.com> - 2012-01-02 10:18 -0800
Re: socket.gethostbyaddr( os.environ['REMOTE_ADDR'] error Roy Smith <roy@panix.com> - 2012-01-02 13:42 -0500
Re: socket.gethostbyaddr( os.environ['REMOTE_ADDR'] error Νικόλαος Κούρας <nikos.kouras@gmail.com> - 2012-01-02 11:51 -0800
Re: socket.gethostbyaddr( os.environ['REMOTE_ADDR'] error Roy Smith <roy@panix.com> - 2012-01-02 15:31 -0500
Re: socket.gethostbyaddr( os.environ['REMOTE_ADDR'] error Νικόλαος Κούρας <nikos.kouras@gmail.com> - 2012-01-09 14:19 -0800
Re: socket.gethostbyaddr( os.environ['REMOTE_ADDR'] error Dominic Binks <dbinks@codeaurora.org> - 2012-01-09 14:35 -0800
Re: socket.gethostbyaddr( os.environ['REMOTE_ADDR'] error Νικόλαος Κούρας <nikos.kouras@gmail.com> - 2012-01-09 15:04 -0800
Re: socket.gethostbyaddr( os.environ['REMOTE_ADDR'] error Thomas Rachel <nutznetz-0c1b6768-bfa9-48d5-a470-7603bd3aa915@spamschutz.glglgl.de> - 2012-01-10 07:42 +0100
Re: socket.gethostbyaddr( os.environ['REMOTE_ADDR'] error Chris Angelico <rosuav@gmail.com> - 2012-01-10 18:29 +1100
Re: socket.gethostbyaddr( os.environ['REMOTE_ADDR'] error Chris Angelico <rosuav@gmail.com> - 2012-01-10 10:14 +1100
Re: socket.gethostbyaddr( os.environ['REMOTE_ADDR'] error Nick Dokos <nicholas.dokos@hp.com> - 2012-01-09 18:32 -0500
Re: socket.gethostbyaddr( os.environ['REMOTE_ADDR'] error Chris Angelico <rosuav@gmail.com> - 2012-01-10 13:08 +1100
Re: socket.gethostbyaddr( os.environ['REMOTE_ADDR'] error Νικόλαος Κούρας <nikos.kouras@gmail.com> - 2012-01-02 11:54 -0800
Page 2 of 2 — ← Prev page 1 [2]
| From | Chris Angelico <rosuav@gmail.com> |
|---|---|
| Date | 2012-01-10 18:29 +1100 |
| Message-ID | <mailman.4583.1326180571.27778.python-list@python.org> |
| In reply to | #18738 |
On Tue, Jan 10, 2012 at 5:42 PM, Thomas Rachel <nutznetz-0c1b6768-bfa9-48d5-a470-7603bd3aa915@spamschutz.glglgl.de> wrote: > BTW: This behaviour might be useful with gethostbyaddr() as well - if the > first one returned has gone away, you have the chance to reach the 2nd > one... In its directest sense, probably not. All you're getting is multiple names for the same IP address. But if some of those names resolve to multiple IP addresses, then it's entirely possible that what you say is so. ChrisA
[toc] | [prev] | [next] | [standalone]
| From | Chris Angelico <rosuav@gmail.com> |
|---|---|
| Date | 2012-01-10 10:14 +1100 |
| Message-ID | <mailman.4554.1326150869.27778.python-list@python.org> |
| In reply to | #18712 |
On Tue, Jan 10, 2012 at 9:35 AM, Dominic Binks <dbinks@codeaurora.org> wrote: > The address database can have multiple names for the same IP address so > gethostbyaddr returns a list - [0] being the first item in the list (and > usually considered the canonical name) Point to note: The inverse operation, getting IP addresses from names, quite frequently returns multiple results - and in that case, there's no "canonical name". You'll still usually want to take the zeroth (first) item in the list, but often the list will change in order. Try, for instance: $ dig +short www.google.com which uses DNS rotation as a form of load-balancing. In any case, you normally just take the first entry. ChrisA
[toc] | [prev] | [next] | [standalone]
| From | Nick Dokos <nicholas.dokos@hp.com> |
|---|---|
| Date | 2012-01-09 18:32 -0500 |
| Message-ID | <mailman.4558.1326152352.27778.python-list@python.org> |
| In reply to | #18712 |
Chris Angelico <rosuav@gmail.com> wrote: > On Tue, Jan 10, 2012 at 9:35 AM, Dominic Binks <dbinks@codeaurora.org> wrote: > > The address database can have multiple names for the same IP address so > > gethostbyaddr returns a list - [0] being the first item in the list (and > > usually considered the canonical name) > > Point to note: The inverse operation, getting IP addresses from names, > quite frequently returns multiple results - and in that case, there's > no "canonical name". You'll still usually want to take the zeroth > (first) item in the list, but often the list will change in order. > Try, for instance: > > $ dig +short www.google.com > > which uses DNS rotation as a form of load-balancing. > > In any case, you normally just take the first entry. > On both 2.6.6 and 2.7.1, the doc says: ,---- | >>> help(socket.gethostbyaddr) | Help on built-in function gethostbyaddr in module _socket: | | gethostbyaddr(...) | gethostbyaddr(host) -> (name, aliaslist, addresslist) | | Return the true host name, a list of aliases, and a list of IP addresses, | for a host. The host argument is a string giving a host name or IP number. `---- so socket.gethostbyaddr(os.environ['REMOTE_ADDR'])[0] is the 0th element of the tuple, i.e. the *name* that is returned. So (unless I'm confused which is always a distinct possibility) this has nothing to do with load-balancing or multiple addresses: it's the equivalent of dig +short -x <addr> Nick
[toc] | [prev] | [next] | [standalone]
| From | Chris Angelico <rosuav@gmail.com> |
|---|---|
| Date | 2012-01-10 13:08 +1100 |
| Message-ID | <mailman.4570.1326161318.27778.python-list@python.org> |
| In reply to | #18712 |
On Tue, Jan 10, 2012 at 10:32 AM, Nick Dokos <nicholas.dokos@hp.com> wrote: > Chris Angelico <rosuav@gmail.com> wrote: >> Point to note: The inverse operation, getting IP addresses from names, > > so socket.gethostbyaddr(os.environ['REMOTE_ADDR'])[0] is the 0th element > of the tuple, i.e. the *name* that is returned. Correct, I was drawing a noteworthy parallel with the inverse - gethostbyname. ChrisA
[toc] | [prev] | [next] | [standalone]
| From | Νικόλαος Κούρας <nikos.kouras@gmail.com> |
|---|---|
| Date | 2012-01-02 11:54 -0800 |
| Message-ID | <9d7740a3-90e2-44bf-ab46-9d98f3c5518c@x20g2000yqe.googlegroups.com> |
| In reply to | #18339 |
On 2 Ιαν, 20:42, Roy Smith <r...@panix.com> wrote: > In article > <bacea15d-fae0-4b1f-8a8e-a8b06b561...@t30g2000vbx.googlegroups.com>, > ÉΪɫɻόλαος Κούρας <nikos.kou...@gmail.com> wrote: > > > I'am trying to present myself through my webpage as computer tech. > > Is the background music so bad?! :-) > > Yes. Background music on web sites is evil. Evil?!?! How come? :)
[toc] | [prev] | [standalone]
Page 2 of 2 — ← Prev page 1 [2]
Back to top | Article view | comp.lang.python
csiph-web