0

(does the title make sense? cause I'm not sure)

I want to host my own site. I've setup an Apache Server and I am able to call the site via IP. Now I want to call it via a domain.

I have an extra domain from GoDaddy, normally to use those domains I change the Nameserver to the ones my Hosting is providing e.g. ns1.example.com and ns2.example.com, how do I setup the ns1.example.com and ns2.example.com on my webserver so that I can use it on my GoDaddy account?

Sorry if this is noobish I'm new to this server stuff.

Appreciate the help! Thanks!

7
  • Do you want to be able to resolve name from your web applications, or to access you web application by it's name instead of IP ?
    – mveroone
    Aug 30, 2013 at 9:35
  • @Kwaio access my web applications by its domain name instead of IP.
    – Jo E.
    Aug 30, 2013 at 9:37
  • I'm not familiar with godaddy and its interface, but what you need to do is to configure for example www.example.com to your IP address on their DNS Zone configuration page. There's nothing else to do server-side, but maybe change /etc/hosts so www.example.com resolves to your server and add ServerName www.example.comto your apache (virtualhost) configuration
    – mveroone
    Aug 30, 2013 at 9:40
  • When their interface asks for the nameserver I type-in my IP(e.g. 1.1.1.1) and click ok. It then returns that what I typed-in is an invalid Nameserver and TLD error. I tried searching for that TLD error and majority of my finds say that its due to an Invalid Nameserver. Any ideas?
    – Jo E.
    Aug 30, 2013 at 9:48
  • 2
    You have to use their nameservers, and edit the Zone to add a "A" field mapping 1.1.1.1to www.example.com help.wildapricot.com/display/DOC/Godaddy+DNS+Setup+example
    – mveroone
    Aug 30, 2013 at 9:54

1 Answer 1

1

Configuring DNS :

I have no idea of how to do that through godaddy's interface but here is what you need :

You have delegated the hosting of your DNS zone "example.com" to GoDaddy. So they are the one managing what's in the zone.

Now, for your server to be callable by its name, you have to make GoDaddy add a "A Record" to your zone, mapping www.example.comto your IP (say 12.13.14.15). You may want to consult wikipedia about how the DNS protocol really works.

Once your DNS zone is set, it's also better to modify your server-side configuration :

Set your server name in /etc/hosts :

127.0.0.1 localhost localhost.localdomain 12.13.14.15 www www.example.com

This will allow your host to resolve itself quicker than if it has to make a DNS query...

Modify your system name :

(if the web server is its only service otherwise another system could be better)

hostname www.example.com

Make apache aware of its name

In your apache-httpd configuration, (inside VirtualHosts if you use them) add this directive :

ServerName "www.example.com"

My explanation could be more plateform/distribution independent and/or more detailled, so if anyone wants to suggest additions/modifications, don't hesitate.

Not the answer you're looking for? Browse other questions tagged .