How to develop a virtual domain Name System

Source: Internet
Author: User
Tags bind html page name database
Everyone in the use of such as yourname.yeah.net such denoted domain name is very convenient, there are many people think: if I can make their own server can also achieve denoted domain name is good. It's not complicated, actually. After reading this article, you can also do a denoted domain Name System.
The key technology of denoted domain Name System is: to implement Web page redirection (redirctory). In essence, the denoted domain Name system is completely different from the virtual machine system. The virtual domain name and IP of the virtual machine exist one by one correspondence. The denoted domain Name system does not need to do one by one mapping domain names and IP. That is, it doesn't require a complex domain name resolution mechanism or a virtual machine, and it does what it does when you request Yourname.somedomain, redirecting your browser to where you originally stored the HTML page.
To illustrate the better, the following illustration:
I provide the source program is the operating environment is: RedHat 5.1 Linux under the Apache1.3.6 Web server +php3 language.
Before we write a program, we need to set up our servers first. First, let the Apache server support PHP3. To ftp.redhat.com download mod_php-2.0.1-9.i386.rpm, after installation, modify/etc/httpd/conf/http.conf file, remove
Set up the DNS server so that it can resolve the generic domain name. Common UNIX and Linux system DNS resolution is done by the bind daemon, Bind4 and Bind8 configuration files/etc/named.boot and name.conf respectively, configured according to your system changes. Set the configuration file for Bind/etc/named.boot, in which you add the phrase "primary domain.com Db.domain", adding a new domain record. Add in/etc/name.conf:
Zone "domain.com" {
Type master;
File "Db.domain";
};
Create a new primary domain record file Db.domain in/var/name/in the format:
N SOA dns.domain.com root.domain.com (
199811291; Serial
28800 refresh;
7200; retry.
604800; expire.
86400); minimum
Dns
MX Ten dns.domain.com.
DNS A 202.115.135.50
www A 202.115.135.50
* A 202.115.135.50
The key is the last sentence, which points to the same IP for all hostname that may be unmarked throughout the domain.
Perform/USR/SBIN/NDC reload and reload the domain name database. Test, at this time should be ping a domain of the host (except already marked), all point to the specified IP, then the DNS server settings completed.
The final step is to compile the PHP3 script. We have just explained the whole principle in detail in the diagram, so it is not very difficult to write a redirect program.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.