Hostname vs domain name when using dynamic DNS?

6,828

Solution 1

When I used DynDNS for their free dynamic service, I used foobar.dyndns.net as the domain and had the wildcard redirect enabled. That let everything work more or less transparently, since I could have local DNS and use vhosts to make sites appear at the same URLs on the inside and the outside.

crb is completely correct that you can use whatever you want as an internal domain, but this setup always worked well for me. I think wildcard requires paying now or something, though; in which case this is markedly less useful. ;)

Solution 2

There need be no connection between any external DNS name and any hostnames/internal DNS.

What you call the hostname (sometimes the 'local part'), should be alphanumeric, no dots. There's a whole RFC on how to pick a name.

Your DNS suffix ('domain name') is added to hostnames when you try and resolve them. As you say, even if you have servers 'foo' and 'bar', it doesn't help you to type 'ping baz' and get a different dyndns.net customer. (It doesn't hurt either.)

It is possible to select your own internal domain - I personally tend to use something at '.tla' from habit, as it's not ever going to conflict with anything on the Internet. Don't use .local, as that has a specific meaning.

Share:
6,828

Related videos on Youtube

hpy
Author by

hpy

Updated on September 18, 2022

Comments

  • hpy
    hpy over 1 year

    I've setup a dynamic DNS service with DynDNS, let's call it:

    foobar.dyndns.net

    When I setup a Linux server, what should be my hostname and domain name??

    For instance, if I setup Slackware Linux, the installation program asks for them, and if I enter "foobar.dyndns.net" for the hostname and domain name, the installation sets up my server as "foobar.dyndns.net.foobar.dyndns.net", which obviously doesn't look right.

    What is the correct way to do this when using dynamic DNS? If I use "foobar" as the hostname, and "dyndns.net" as the domain name, it doesn't seem right either, as I don't really "own" or exercise control over the domain "dyndns.net".

    Thanks for your answers.

  • hpy
    hpy almost 13 years
    So do you mean I can have anything, say, "abc.def.ghi" for my hostname, and my existing "foobar.dyndns.net" for my domain name during server setup? If so, to connect to the server I would use "foobar.dyndns.net" regardless of what I setup the hostname to be? Or would it become "abc.def.ghi.foobar.dyndns.net"?
  • Daniel B.
    Daniel B. almost 13 years
    Your hostname should be whatever you want to name your computer. Your DNS suffix should be whatever domain you're on, or make one up if you're not in a domain. I recommend you take a look at this dev.slackware.it/docs/howto.php?page=16
  • Daniel B.
    Daniel B. almost 13 years
    What crb is saying is that your internal and external domain name are two different things. What dyndns does is receive requests for foobar.dyndns.com and forward them to your router's external IP. You then need to tell your router that requests on port 80(or whatever else you need) are forwarded to your server. Your hostname and dns suffix for your server are separate, dyndns won't even know what they are (nor should it).
  • crb
    crb almost 13 years
    Clarified a little that the hostname should be a single alphanumeric, no .s
  • Michael Lowman
    Michael Lowman almost 13 years
    P.S. and the hostname being whatever hostname you like; my naming scheme at the time was 17th century scientists and philosphers. So boyle, bacon, descartes, etc.