-2

Edit: Main questions - How do you setup Nameservers? Do I have to setup the DNS, if so, how? I just want to be able to type in www.mydomain.com and have it point to my server here locally. I don't know which configuration files I have to change to achieve that. I just know that I have to specify nameservers at the domain, so that requests to that domain, send it to the server that holds the sites(My Server).


I've been trying to setup an unused Ubuntu(11.04?) server we have to use as a webhost(Just our business sites to cut costs) but i'm kind of stuck on how to do so. I have the standard apache,php, mysql stuff installed, and i've installed WebMin, which all appears to be working.

What i'm stuck on now is the whole Nameserver/DNS bit. Trying to get my head around it has been difficult. They seem like the same thing, but one is a subset of the other? Or they're dependent on each other, i.e. DNS refers to Nameserver to get it's information. My questions are: We only have one additional IP Address, can a server be setup as a webhost with only 1 IP? How do I change the servers IP? Right now it's just connected to our network as if it were another computer.

In my experience, all hosts have always given two Nameserver IP's, usually sequential, like 255.255.255.21 and 255.255.255.22 which are set in the domain as ns1.domain.com/ns2.domain.com. How do you create the nameservers for your server? DNS appears to be a file in /etc/bind/named.conf and named.conf.local. Is this a package i'll have to install? What order should I do all of this in? Can all of this be put onto one server?

Thanks in advance for any help or suggestions offered.

Jonathan
  • 1
  • 2
  • Are you asking how to setup and configure a nameserver? Too many questions, try boiling it down to just one. – h0tw1r3 Jan 03 '13 at 16:11
  • Usually a system acts as a DNS client asking some nameservers (listed in /etc/resolv.conf) the resolution hostname -> IP. Some system can act as DNS servers, in this case a specific daemon is needed. Are you sure that you want to run your own DNS server? – marcoc Jan 03 '13 at 16:12
  • @h0tw1r3 I've updated my post, my specific questions should be more clear now. :) And marcoc, I'm not sure if that's what I need? I was just under the impression that I had to have a DNS on my server in order for requests to specific domains on my server to be resolved. – Jonathan Jan 03 '13 at 16:31

2 Answers2

1

Can you answer following questions:

  1. Do you have any registered domain name for this?
  2. Do you have any public IP?

If answer to any of the above question is "NO", you can't do anything without it.

If you just want a demo site which resolves in your machine only, you can use /etc/hosts file in Unix and C:\Windows/system32/drivers/etc/hosts file in Windows

Suku
  • 2,036
  • 13
  • 15
  • Yes, we have multiple domains registered. I just don't have nameservers to give those domains yet, trying to figure out how to create those for my server. And I believe we have a public IP, is there a way to check this? Edit: Just ran wget -O - -q icanhazip.com and it returned our IP, not sure if that means it's public or not. – Jonathan Jan 03 '13 at 17:28
  • Ok. Where you performed domain registration? Do you have any domain control(DNS) panel? – Suku Jan 03 '13 at 17:33
  • Godaddy. And some of the domains do, but some have "DNS Manager: Not hosted here" The domains which have that are the ones I need pointing to our server. Why I was asking about DNS servers in addition to nameservers. – Jonathan Jan 03 '13 at 17:39
  • http://support.godaddy.com/help/article/668/registering-your-own-nameservershosts . "Actually, I can help you in this, but conversation will become long here and that I hate." – Suku Jan 03 '13 at 17:55
  • Hmm. The article tells me where to provide the nameservers for the domain, but not how to create them? What I mean is, I could give it my.ip.address.here and it would look to my server, but will the server understand? Or do I have to create a dns on it for it to function properly? Though I guess apache would take over once it got the request for the domain? – Jonathan Jan 03 '13 at 18:46
  • Jonathan, do you know whether you have DNS hosting in godaddy? If you have it, everything is very simple. – Suku Jan 03 '13 at 19:02
  • It doesn't look that way as the DNS Manager says it's not hosted there. Which implies I need a DNS somewhere to resolve all this? Are DNS and nameservers the same thing? Some info seems to say that while other info doesn't. Would it be possible to move this to chat? – Jonathan Jan 03 '13 at 19:50
  • let us [continue this discussion in chat](http://chat.stackexchange.com/rooms/6951/discussion-between-suku-and-jonathan) – Suku Jan 04 '13 at 01:54
0

I just want to be able to type in www.mydomain.com and have it point to my server here locally

You can do that my setting an IP (localhost in this case) to a specific host manually in the /etc/hosts file like this:

127.0.0.1 www.mydomain.com

You OS then checks the url from this file first before contacting the dns.

lukassteiner
  • 135
  • 5
  • When I said locally I meant that the server resides in our local office, a server "room" a few doors down from my office. Sorry for the mixup. – Jonathan Jan 03 '13 at 20:05
  • oh sorry I did not see that. If you want, you can initiate a chat and I might be able to help you with that problem. – lukassteiner Jan 03 '13 at 21:07