Hie all,
I'm developing a bulk sms website, there are users and resellers for the site. I want to map my to another ip through A record. Problem is how to identify the ip user / reseller ?
Please help me.
Hie all,
I'm developing a bulk sms website, there are users and resellers for the site. I want to map my to another ip through A record. Problem is how to identify the ip user / reseller ?
Please help me.
Short practical summary and a reliable approach.
The key design decision is whether the central application should receive the HTTP requests or the reseller's server should. Pointing an A record at a reseller's hosting IP sends traffic to that reseller's machine — the central app will not see those requests. For a centralized service that wants to identify a reseller automatically, have resellers point their hostnames to the central service (CNAME to a canonical host when possible, or an A to the central IP for apex domains) and then use the HTTP Host header / SNI to map host -> reseller record in the database. As pointed out, identifying by client/server IP alone is brittle (shared hosts, NAT, CDNs, dynamic addresses).
Practical server-side workflow (recommended)
Example fallback lookup (illustrative PHP):
$host = strtolower($_SERVER['HTTP_HOST'] ?? '');
$reseller = db_get_one('SELECT * FROM resellers WHERE domain = ? LIMIT 1', [$host]);
if (!$reseller) {
$ip = explode(',', ($_SERVER['HTTP_X_FORWARDED_FOR'] ?? $_SERVER['REMOTE_ADDR']))[0];
$reseller = db_get_one('SELECT * FROM resellers WHERE server_ip = ? LIMIT 1', [$ip]);
}
if (!$reseller) { header('HTTP/1.1 403 Forbidden'); exit; } Important operational notes and pitfalls
This approach keeps DNS simple, avoids brittle IP-matching, and provides secure server-to-server verification while supporting both central-hosted and reseller-hosted scenarios.
Jump to Post— phorce 131Don't think I quite understand, or, if I do, why would you want to do such a thing..
Ok, have a form that asks the user if (s)he is a user or a re-seller. Then, create a database that stores this information. Everytime you want to check, you can check …
Don't think I quite understand, or, if I do, why would you want to do such a thing..
Ok, have a form that asks the user if (s)he is a user or a re-seller. Then, create a database that stores this information. Everytime you want to check, you can check to see if the IP address matches the re-sellers/users IP stored within the database. What if the user's IP address changes? What if they access a different computer? Is this therefore a really efficent way to identifying someone?
Dear phorce, Thanks for your reply.
Here we are talking about Hosting ip address ( You will find on Control panel ). I want to add a reseller using his / her server ip address. Then i will add "A Record" to that ip address using Simple DNS Editor so that the website / sub-domain will map to our domain. Now i want to check the db from that ip address.
Thanks in advance.
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.