==== Smart Subdomains ==== You can access the Smart Subdomains for the current domain by scrolling down to the Advanced Features section: {{advanced_features.png}} Smart Subdomains are special subdomains that return IP addresses generated by scripts. These scripts get information on the user requesting the IP address (like his/her country, network, other information) and make a decision on what IP address to return. The script linked to a smart subdomain runs every time a user requests the IP address of the subdomain. The scripts are written in PHP and run on a limited version of the PHP virtual machine. **Normal subdomains take precedence over smart subdomains**, that is if you have both a normal subdomain and a smart subdomain **with the same name** on the same domain, GeoScaling will return the IP address of the normal subdomain, and will **not** execute the script inside the smart subdomain. A script could for instance redirect users to the closest mirror based on the country or the network of the user, or to the least loaded machine, or redirect users to healthy servers when some of the servers go down. The information that GeoScaling can send to a script is: * the 2 characters ISO code of the visitor's country (for example es for Spain, it for Italy etc) * city info - country, city name, latitude, longitude... * the AS number (network name) of the visitor (example: as39756 is the HOSTWAY Romania network) * [[Uptime monitoring|uptime information]] on your servers * [[Sending extra information to DNS2 with the XML-RPC API |extra information]] such as server load, sent through our [[Sending extra information to DNS2 with the XML-RPC API |XML-RPC API]] * the name of the smart subdomain connected to this script (for example www.example.com) * the IP address of the user requesting the IP The script can then use any of the above items, or a combination, to choose which IP address to return to the user. Please click [[Short programming guide for smart subdomains|here]] for a short guide on writing smart subdomain scripts.