Basically, I go ahead and get the domainname from a provider and then set things up from there. I use ehost.com, which works ok, but if you have someone better, then go with them. At ehost, we pay for "domain dashboard", which is probably not required, but it makes it easier to set up dns. Using domain dashboard, we can redirect traffic as we see fit. It might be possible to just redirect all traffic from a domain to an IP address and get that to work. There are several steps.
bash-3.00$ dig any www.truststc.org ; <<>> DiG 2.0 <<>> any www.truststc.org ;; ->>HEADER<<- opcode: QUERY , status: NOERROR, id: 6 ;; flags: qr rd ra ; Ques: 1, Ans: 1, Auth: 2, Addit: 0 ;; QUESTIONS: ;; www.truststc.org, type = ANY, class = IN ;; ANSWERS: www.truststc.org. 3600 CNAME trust.eecs.berkeley.edu. ;; AUTHORITY RECORDS: truststc.org. 73797 NS ns2.ehost.com. truststc.org. 73797 NS ns1.ehost.com. ;; Sent 1 pkts, answer found in time: 92 msec ;; FROM: carson.EECS.Berkeley.EDU to SERVER: default -- 128.32.48.21 ;; WHEN: Mon Apr 28 13:27:54 2008 ;; MSG SIZE sent: 34 rcvd: 116 bash-3.00$trust.eecs goes to 128.32.244.34 (except email, more on that below)
bash-3.00$ dig any trust.eecs.berkeley.edu ; <<>> DiG 2.0 <<>> any trust.eecs.berkeley.edu ;; ->>HEADER<<- opcode: QUERY , status: NOERROR, id: 6 ;; flags: qr aa rd ra ; Ques: 1, Ans: 2, Auth: 6, Addit: 7 ;; QUESTIONS: ;; trust.eecs.berkeley.edu, type = ANY, class = IN ;; ANSWERS: trust.eecs.berkeley.edu. 86400 A 128.32.244.34 trust.eecs.berkeley.edu. 86400 MX 5 andrews.eecs.berkeley.edu. ;; AUTHORITY RECORDS: eecs.berkeley.edu. 86400 NS vangogh.CS.berkeley.edu. eecs.berkeley.edu. 86400 NS ns.CS.berkeley.edu. eecs.berkeley.edu. 86400 NS ns.eecs.berkeley.edu. eecs.berkeley.edu. 86400 NS cgl.UCSF.edu. eecs.berkeley.edu. 86400 NS adns1.berkeley.edu. eecs.berkeley.edu. 86400 NS adns2.berkeley.edu. ;; ADDITIONAL RECORDS: andrews.eecs.berkeley.edu. 86400 A 128.32.244.30 ns.CS.berkeley.edu. 86400 A 169.229.60.61 ns.eecs.berkeley.edu. 86400 A 169.229.60.153 cgl.UCSF.edu. 62066 A 169.230.27.20 adns1.berkeley.edu. 153260 A 128.32.136.3 adns2.berkeley.edu. 153264 A 128.32.136.14 vangogh.CS.berkeley.edu. 86400 A 128.32.112.208 ;; Sent 1 pkts, answer found in time: 0 msec ;; FROM: carson.EECS.Berkeley.EDU to SERVER: default -- 128.32.48.21 ;; WHEN: Mon Apr 28 13:30:44 2008 ;; MSG SIZE sent: 41 rcvd: 315 bash-3.00$Andrews is my machine that is running the webservers, it has 3 virtual interfaces, including the 128.32.244.34 address:
andrews.EECS.Berkeley.EDU:root:> ifconfig -a lo0: flags=2001000849For apache, the 128.32.244.34 ip address appears in files like:mtu 8232 inde x 1 inet 127.0.0.1 netmask ff000000 bge0: flags=1004843 mtu 1500 index 2 inet 128.32.244.30 netmask ffffff00 broadcast 128.32.244.255 ether 0:3:ba:c6:e7:a9 bge0:1: flags=1000843 mtu 1500 index 2 inet 128.32.244.31 netmask ffffff00 broadcast 128.32.244.255 bge0:2: flags=1000843 mtu 1500 index 2 inet 128.32.244.32 netmask ffffff00 broadcast 128.32.244.255 bge0:3: flags=1000843 mtu 1500 index 2 inet 128.32.244.34 netmask ffffff00 broadcast 128.32.244.255 andrews.EECS.Berkeley.EDU:root: %C2>
/usr/local/apache/conf/httpd-vhosts.conf:Things get fairly tricky with sendmail. We use /etc/mail/virtusertable and /etc/sendmail.cw to get things going So, bottom line, if you have a domain name, you should be able to have your domain registrar forward all traffic to your website. You can either do it via an IP address or a CNAME to another name. It is better to use a CNAME if you can because if your IP address changes on campus then things will work seamlessly. Also, you need to set up both your www.yourdomain.org and yourdomain.org to go to your machine./usr/local/apache/conf/rewrite.conf:RewriteCond %{HTTP_HOST} ^128.32.244.34$ /usr/local/apache/conf/ssl.conf:
You can use apache rewrites to redirect traffic so that http://ramp.eecs.berkeley.edu get redirected to your http://yourdomain.org