hostname and dns

Discussion in 'ASP .Net' started by Spartaco, Apr 1, 2005.

  1. Spartaco

    Spartaco Guest

    hi, I was curious to know why the property Request.UserHostName gives me the
    IP of visitors instead of their dns name as stated in the documentation.
    It's something wrong with the configuration of my server(win2003) or it's
    always this way ?

    I think it's a problem of my server, so if you confirm my though, how can I
    distinguish by code if this property is returning an ip or a dns name?

    thanks to everybody
    Spartaco, Apr 1, 2005
    #1
    1. Advertising

  2. Spartaco

    MattC Guest

    How are the users accessing youe site, is it anonymous access?

    MattC

    "Spartaco" <> wrote in message
    news:Rcc3e.39872$...
    > hi, I was curious to know why the property Request.UserHostName gives me
    > the IP of visitors instead of their dns name as stated in the
    > documentation. It's something wrong with the configuration of my
    > server(win2003) or it's always this way ?
    >
    > I think it's a problem of my server, so if you confirm my though, how can
    > I distinguish by code if this property is returning an ip or a dns name?
    >
    > thanks to everybody
    >
    MattC, Apr 1, 2005
    #2
    1. Advertising

  3. Spartaco

    Spartaco Guest

    yes, anonymous.

    "MattC" <> wrote in message
    news:%23n%...
    > How are the users accessing youe site, is it anonymous access?
    >
    > MattC
    Spartaco, Apr 1, 2005
    #3
  4. Spartaco

    MattC Guest

    I think (dont take it as 100%) that with anonymous access user credentials
    are not challenged, as in the server will not ask for them, so the only
    thing available is IP.

    MattC
    "Spartaco" <> wrote in message
    news:78d3e.39967$...
    > yes, anonymous.
    >
    > "MattC" <> wrote in message
    > news:%23n%...
    >> How are the users accessing youe site, is it anonymous access?
    >>
    >> MattC

    >
    >
    MattC, Apr 1, 2005
    #4
  5. Spartaco

    Patrice Guest

    If I remember, this is a server setting (it returns the IP because
    resolution may slow down a bit each request).

    You have basically two options :
    - change the server setting to resolve the name for each request (see the
    KB)
    - resolve this yourself as needed (System.Net.Dns allows to do that).

    Patrice

    --

    "Spartaco" <> a écrit dans le message de
    news:Rcc3e.39872$...
    > hi, I was curious to know why the property Request.UserHostName gives me

    the
    > IP of visitors instead of their dns name as stated in the documentation.
    > It's something wrong with the configuration of my server(win2003) or it's
    > always this way ?
    >
    > I think it's a problem of my server, so if you confirm my though, how can

    I
    > distinguish by code if this property is returning an ip or a dns name?
    >
    > thanks to everybody
    >
    >
    Patrice, Apr 1, 2005
    #5
  6. Spartaco

    Spartaco Guest

    thanks Patrice I thought was something like that, I'm going to use the Dns
    class to resolve the hostname, anyway how can I know if that property
    contains an ip address (v4 or v6) or a dns name?

    maybe when

    Request.UserHostAddress != Request.UserHostName ? dns : ip

    thanks

    "Patrice" <> wrote in message
    news:%...
    > If I remember, this is a server setting (it returns the IP because
    > resolution may slow down a bit each request).
    >
    > You have basically two options :
    > - change the server setting to resolve the name for each request (see the
    > KB)
    > - resolve this yourself as needed (System.Net.Dns allows to do that).
    >
    > Patrice
    >
    > --
    >
    > "Spartaco" <> a écrit dans le message de
    > news:Rcc3e.39872$...
    >> hi, I was curious to know why the property Request.UserHostName gives me

    > the
    >> IP of visitors instead of their dns name as stated in the documentation.
    >> It's something wrong with the configuration of my server(win2003) or it's
    >> always this way ?
    >>
    >> I think it's a problem of my server, so if you confirm my though, how can

    > I
    >> distinguish by code if this property is returning an ip or a dns name?
    >>
    >> thanks to everybody
    >>
    >>

    >
    >
    Spartaco, Apr 1, 2005
    #6
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. AWieminer
    Replies:
    0
    Views:
    741
    AWieminer
    Jul 12, 2005
  2. Mike Kansky

    DNS Resolve IP to HostName

    Mike Kansky, Jun 6, 2006, in forum: ASP .Net
    Replies:
    0
    Views:
    5,007
    Mike Kansky
    Jun 6, 2006
  3. cjblaine
    Replies:
    1
    Views:
    324
    Ned Deily
    Apr 28, 2011
  4. Sam Roberts
    Replies:
    0
    Views:
    196
    Sam Roberts
    Mar 20, 2005
  5. gavino
    Replies:
    2
    Views:
    157
    Ted Zlatanov
    Jul 27, 2006
Loading...

Share This Page