ip-address

Dns.GetHostAddresses() only returns IPv6 addresses . How to get Local IPv4?

不羁的心 提交于 2019-12-11 07:45:18
问题 According to Dotnet reference , Dns.GetHostAddresses("") should return IPv4 addresses . However I am getting only IPv6 on my windows 7 machine. I tried the program on a different windows 7 still the same result. It only returned IPv4 correctly on an XP machine. If I try , Dns.GetHostEntry(""); It now correctly returns one IPv4 and one IPv6 . How do I get IPv4 from GetHostAddresses() because I don't want to use GetHostEntry(). It looks up the DNS. Also, say for a computer with 1 Network card,

IP addresses get stored as 0 when converting with PHP ip2long function

蹲街弑〆低调 提交于 2019-12-11 07:27:00
问题 The newsletter_ip field in MySQL is set as an UNSIGNED INT (10). I've also tried INET_ATON to format the data, but my results always look like this. Here is part of my processing code: //Retrieve data from user and create variables $ip_orig = $_SERVER['REMOTE_ADDR']; $ip = ip2long($ip_orig); //Place into database $sql = "INSERT INTO newsletter(newsletter_email, newsletter_ip, newsletter_date, newsletter_time) VALUES('".$email."', '".$ip."', '".$date."', '".$time."')"; I've also tried this

Google Cloud Platform external IP point to an instance in Singapore but shown in US

余生长醉 提交于 2019-12-11 07:24:27
问题 I purchased a GCP VM instance in asia-southeast1 and reserved an external IP in the same region for this. The instance and IP information that is shown in GCP console seems to be okay but when I deploy my website into it, the response is really slow. My static IP VM instance So I lookup my IP and the tool show my IP is from US IP lookup result I am not sure what wrong with my IP or instance, I am new in GCP please help. Thank you. 回答1: If I search the whois data for external IP address of a

get remote Ip address or machine name

被刻印的时光 ゝ 提交于 2019-12-11 07:01:23
问题 I have my GUI files published on a server... this server is where the IIS is running.. Now i access my GUI from a remote machine. how can i get this machines IP address or username. I get the server name of the machine using this code: string svrName = System.Net.Dns.GetHostName(); please help thanks... maybe i was not clear enough: Let me explain again.. there are 2 machines A and B.. A is where i have my published files for the GUI and also the IIS... the above code gives me the name of

Subdomain IP address changed but client still getting directed to old site

此生再无相见时 提交于 2019-12-11 05:58:14
问题 I manage a web site that used to be hosted on Server A. I gave clients a subdomain url that pointed to this server, e.g. app1.example.com I have moved my web site to a new server, Server B. I changed the IP address of app1.example.com (via the domain name host company) to point to the new server and this worked ok, for me at least. However, I have one client that is still getting directed to the old server. When I get the client to ping app1.example.com it is trying to ping the old Server A.

Compare IP List to another IP List or IP Range

好久不见. 提交于 2019-12-11 05:48:31
问题 I've created a python project that scans an ip range (ie. x.y.z.0/24) and returns a list of online hosts. It saves the online hosts list to file with just the ip's (ie ['192.168.0.1', '192.168.0.2', '192.168.0.8',...]. I'm having trouble with this next step. I'd like to compare this online hosts list to an IP range to verify that these are computers to eliminate other devices. I have a DHCP Reservation List for computers that I can use. Is there a simple way to do this and update the onHosts

Nodejs distinguishing http requests; multiple devices with same public IP

旧时模样 提交于 2019-12-11 05:42:08
问题 Нello! I'm trying to represent client connections over http with node. Right now I have something like: let names = [ 'john', 'margaret', 'thompson', /* ... tons more ... */ ]; let nextNameInd = 0; let clientsIndexedByIp = {}; let createNewClient = ip => { return { ip, name: names[nextNameInd++], numRequests: 0 }; }; require('http').createServer((req, res) => { let ip = req.headers['x-forwarded-for'] || req.connection.remoteAddress; // If this is a connection we've never seen before, create a

Reachability with IP address won't work.

余生长醉 提交于 2019-12-11 04:36:11
问题 After inputting the Rechability classes Apple provided. Also after inputting this, Reachability reachabilityWithAddress:(const struct sockaddr_in *)hostAddress. How should we input the IP address we want to check into this line? This is the part where i'm really lost at. 回答1: struct sockaddr_in is a low-level "socket address" type used by BSD sockets. We generally don't deal with them at the Cocoa level, but they can creep up from time to time, including in Apple's demo class. The reason

IP address representation in the Maxmind Geolitecity database

走远了吗. 提交于 2019-12-11 04:29:45
问题 I have the Maxmind Geolitecity database in a Mysql database. I could see field like startIpNum and endIpNum . The values for those fields are like this: 16777216 for startIpNum and 16777471 for endIpNum`. My ip is 115.184.126.186, how can I convert my ip to match the startIpNum or endIpNum ? 回答1: Either use inet_aton() as suggested by lmz, or do it in php using: http://php.net/manual/en/function.ip2long.php Note that this function returns an signed integer, meaning ranging from − 2,147,483

PHP/mysqli: Inserting IP address with mysqli_stmt_bind_param()

夙愿已清 提交于 2019-12-11 04:03:25
问题 I have a database table which contains an unsigned integer field to store the visitor's IP address: `user_ip` INT(10) UNSIGNED DEFAULT NULL, Here's the snippet of PHP code which tries to store the IP address: $ipaddr = $_SERVER['REMOTE_ADDR']; if ($stmt = mysqli_prepare($dbconn, 'INSERT INTO visitors(user_email, user_ip) VALUES (?,?)')) { $remote_ip = "INET_ATON('$ipaddr')"; mysqli_stmt_bind_param($stmt, 'ss', $email, $remote_ip); if (mysqli_stmt_execute($stmt) === FALSE) return FALSE; $rows