LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   Directing a domain name to a numeric address (https://www.linuxquestions.org/questions/linux-newbie-8/directing-a-domain-name-to-a-numeric-address-4175450147/)

kovlin 02-14-2013 11:03 AM

Directing a domain name to a numeric address
 
I'm pretty much new to linux - actually been using unix/linux for 25 years or so but never done any serious administration.

I've got a web site I operate and have outgrown some of the restrictions placed by my current web host - godaddy. I'm experimenting with a virtual dedicated server. (This is probably overkill now but eventually I want to do some additional work unrelated to just running a web site.)

I've stumbled through the setup mostly successfully. I can get to my site using its numeric address and it operates properly, databases and all. But I can't for the life of me figure out how to set everything so that my domain is directed there.

Here's what I have done:

- set my name servers at godaddy (my registrar) to those specified by my vps host
- created a zone file called named.conf in /etc/bind
- set up a virtual host in apache so my domain is listened for

I'm using debian 6.0 and have webmin.

I think I vaguely know that somehow the nameservers need to be made aware of my domain. But does that happen at boot for my server (since it is defined in the named.conf file on my machine)? I've tried rebooting/applying changes/ and so forth with no luck. I've waited 24 hours or so. Maybe that's not long enough but it could take weeks if I have to wait 3 days for propagation every time I try something.

I know that I can forward my domains on godaddy to the numeric address to make the whole thing basically work. But that's not really the best way to do it.

This should be a very common issue people face. When I look online I find lot's of information about how to set up my own name servers with BIND. That seems straightforward but also seems like overkill. Maybe what I need to do is so simple that most people don't need help.

Maybe I just have a fundamental misunderstanding of what I need to do. I'd appreciate any help!

smallpond 02-14-2013 10:20 PM

When I look up www.example.com I go the root name servers, who give me the addresses of the nameservers for the com TLD. I ask those nameservers for the address of the nameserver for example.com. Then I ask THAT nameserver for the address of www.example.com. There's no way to start at the bottom. There has to be a chain from the root all the way down. You can't just run an isolated nameserver and expect it to work, because nobody will know how to get to it. Besides, you can't run a server for $9.99 per year.

Habitual 02-15-2013 07:19 AM

Quote:

I think I vaguely know that somehow the nameservers need to be made aware of my domain.
as long as the IP address (At the Registar!) for each NameServer entry points to a server using the bind9 server|daemon and that server has a zone file for the domain, AND has a A Record, you should be good to go.

and apache serves up the content for the virtualhost entry for that domain.

That is the "flow".
Code:

dig  +short domain.com @IP.address.of.bind.server
should give you the A Record for the domain.

Please let us know...

jpollard 02-15-2013 08:36 AM

Quote:

Originally Posted by smallpond (Post 4891956)
When I look up www.example.com I go the root name servers, who give me the addresses of the nameservers for the com TLD. I ask those nameservers for the address of the nameserver for example.com. Then I ask THAT nameserver for the address of www.example.com. There's no way to start at the bottom. There has to be a chain from the root all the way down. You can't just run an isolated nameserver and expect it to work, because nobody will know how to get to it. Besides, you can't run a server for $9.99 per year.

No. When you lookup www.example.com you go to your local /etc/resolv.conf file to identify a name server to retrieve what it may know of the name. If it is known (in the local cache) it will return that value immediately.

If it is unknown, then the "www" is stripped off an an attempt to identify the name server responsible for that domain (the example.com).

If that server is unknown, then the "example" is stripped off, and an attempt to identify the server responsible for that domain (the .com). Normally this is cached, so a query to the .com name server is done to find "example.com" (which gets cached).

Then the server for "example.com" is queried for "www.example.com" (and that result is cached). The final answer for "www.example.com" is then returned to the user.

If another query for "www.example.com" appears then the server can return the cached value. If a different host is queried (such as "xyz.example.com") the query is sent to the server for example.com as retrieved from the cache.

This minimizes the amount of network traffic by distributing the information.

To handle the cases where the value assigned to the names change, each value sent out by the responsible name server includes a "expiration" time. This allows the updated values to be propagated to various servers, minimizing traffic (and time).

The usual expiration time is two weeks. There is a case for shorter time - such as those IP numbers assigned by DHCP with limited lifetime leases. If the expiration time is about half the lease lifetime then access will still be available MOST of the time. The failures will be self correcting just by waiting a while. If impatient admins want to, they can flush the local servers cache, which will force queries to rebuild the cache with new data.

kovlin 02-15-2013 12:58 PM

Quote:

Originally Posted by Habitual (Post 4892206)
Please let us know...

Thanks for the help so far

I installed bind9, editted/created the appropriate files, and after a few errors (mostly fat-finger but some conceptual) I think I have it set up correctly. Bind9 restarts with no errors and seems to do what I expect based on the messages in the syslog. I get a couple of "sending notifies" for my domain zone and reverse zone as the last related log entries. I assume these are indications that the nameservers are being sent the information they need. But when I use dig I get nothing - no errors but no A records found for my domain.

I'm actually beginning to think that I do know what I am doing at least partially. I can control whether aliases resolve and such on my machine (ftp.example.com for example) but my domain does not appear from outside and dns viewing tools from outside don't find any A records on the nameserver my vps provider gave me.

I even thought about running my own nameserver at least for now but godaddy does not let you enter numeric addresses for the nameserver so that would not help even if I was able to set that up correctly.

At this point I think what I have is correct so I'm going to wait over the weekend to see if things work themselves out. I would think that my updates to the local nameserver should happen quickly but maybe not.

jpollard 02-15-2013 04:55 PM

The local nameserver would happen as soon as you restart it.

For outside access to work the server must be known to its parent domain.

If you have registered your own domain - then that registration would handle it. Most registrars require two servers though - a primary, and a secondary.

Such registration can take a day or two (they have to get their danegeld first). If your domain is xyz.com, you can do a "dig xyz.com" and it will query the "com" domain for your server.

Habitual 02-15-2013 05:01 PM

the actual domain name would be helpful also.


All times are GMT -5. The time now is 07:50 PM.