Difference between REMOTE_HOST and REMOTE_ADDR

后端 未结 4 1698
谎友^
谎友^ 2020-12-05 13:08

What is the difference between these two variables?

REMOTE_HOST and REMOTE_ADDR.

4条回答
  •  抹茶落季
    2020-12-05 13:23

    From RFC-3875:

    • REMOTE_ADDR:The REMOTE_ADDR variable MUST be set to the network address of the client sending the request to the server.
          REMOTE_ADDR  = hostnumber
          hostnumber   = ipv4-address | ipv6-address
          ipv4-address = 1*3digit "." 1*3digit "." 1*3digit "." 1*3digit
          ipv6-address = hexpart [ ":" ipv4-address ]
          hexpart      = hexseq | ( [ hexseq ] "::" [ hexseq ] )
          hexseq       = 1*4hex *( ":" 1*4hex )
    
    • REMOTE_HOST:The REMOTE_HOST variable contains the fully qualified domain name of the client sending the request to the server, if available, otherwise NULL. Fully qualified domain names take the form as described in section 3.5 of RFC 1034 [17] and section 2.1 of RFC 1123 [12]. Domain names are not case sensitive.
    The REMOTE_HOST variable contains the fully qualified domain name of
       the client sending the request to the server, if available, otherwise
       NULL.  Fully qualified domain names take the form as described in
       section 3.5 of RFC 1034 [17] and section 2.1 of RFC 1123 [12].
       Domain names are not case sensitive.
    
          REMOTE_HOST   = "" | hostname | hostnumber
          hostname      = *( domainlabel "." ) toplabel [ "." ]
          domainlabel   = alphanum [ *alphahypdigit alphanum ]
          toplabel      = alpha [ *alphahypdigit alphanum ]
          alphahypdigit = alphanum | "-"
    

提交回复
热议问题