11

I want to use my internet connection to host two personal websites (two different domains). I would also like to host mail for these domains.

This requires hosting my own name server. In the nameservers configuration section on my registrar's website, it requires two name servers. Probably for reliability?

I have previously used zoneedit.com, and they provided me with two nameservers but I would like to host it myself, save myself some coin, and learn how to configure bind for experience.

I only have one internet connection, and only have the ability to host one nameserver. What are you supposed to do with the second name server?

mrdenny
  • 27,074
  • 4
  • 40
  • 68
  • 10
    I'd have to disagree with "Belongs on Superuser" on this one. We're talking about DNS *Servers* here. Whether they're for a personal domain name or not, they're servers and fulfilling a server role. – Evan Anderson Nov 08 '09 at 02:58
  • 4
    "Server Fault is for system administrators and IT professionals, people who manage or maintain computers in a professional capacity." "Two personal websites" does not constitute "in a professional capacity". – womble Nov 08 '09 at 03:40
  • 18
    @womble Your reasoning is terrible; you might as well say that you can't ask about personal programming projects on stackoverflow. The real criterion for the right place to post is whether the topic is being addressed to the right audience, and it's hard to argue that nameserver setup questions should be directed to superuser. – phoebus Nov 08 '09 at 04:51
  • 2
    When it could go either way, I throw the tie to the person asking the question. It's better to encourage people to come here than to beat them up and send them away – Matt Simmons Nov 08 '09 at 04:55
  • 1
    @phoebus: Stack overflow doesn't have a "professional programming only" focus, which makes your argument ludicrous. If you think Serverfault's focus is wrong, then it's not me you want to be arguing with, since I don't run the site. I'm just following the guidelines currently in place. – womble Nov 08 '09 at 06:05
  • 2
    He could just as easily have phrased the question "My company's 2 websites..." – SpaceManSpiff Nov 08 '09 at 14:58
  • 2
    @womble You're just presenting a typical case of conflating blind adherence to the letter of the law and the actual spirit. – phoebus Nov 08 '09 at 22:19
  • 2
    Server-related issues *of all kinds* frequently get migrated over here from StackOverflow. So, in practice, it really doesn't matter whether the question is about a personal or a professional site -- it's still a server-related question. – bigmattyh Nov 09 '09 at 01:25

7 Answers7

18

The requirement to run two nameservers comes from §4.1 of RFC 1034, and is indeed for redundancy.

There are numerous providers who will offer you very cheap "secondary DNS" service where they transfer the zone file from your primary server using AXFR. For example, in the UK we have a well-known provider who'll do secondary service for 50 domains for just £2.30 a month (just over 3 bucks).

This will give you the ability to manage and run the zone yourself, but still give you the resiliency you need.

Alnitak
  • 20,901
  • 3
  • 48
  • 81
  • 2
    The RFC states "By administrative fiat, we require every zone to be available on at least two servers", which means essentially "without any authority to enforce it, we believe you need at least two DNS servers". This is a very shallow view as for example my colo runs on ONE server where both HTTP and DNS servers are hosted. So there is no point in having DNS mirrored elsewhere since if my only server is down, my site is down, period. – rustyx Jan 13 '13 at 20:31
  • 6
    @RustyX it's not that simple - IMHO it's your own view that's shallow here. If your DNS goes down, negative caching (see RFC 2308) will result in people temporarily forgetting that your domain even exists, even if the web server is actually up. Similarly, mail to a domain with broken DNS will get dropped, rather than queued. – Alnitak Jan 13 '13 at 20:55
  • thanks for clarifying the real reasons for having a redundant DNS. Indeed if negative caching and email are very important then it makes sense. But for me it's not an issue. And I've been running a single DNS for years without a problem because it's good enough for what I'm doing. – rustyx Jan 14 '13 at 15:40
  • @Alnitak Mail does not necessarily get dropped when a DNS is temporarily down. There's a difference between the `ServFail` (server failure) and `NXDomain` (non-existent domain) status codes. It seems that mail servers queue in case of `ServFail`, which is what occurs when a DNS server is not reachable. – Ruben Verborgh Aug 02 '16 at 22:03
  • @RubenVerborgh only if the mail server is using DNS APIs that expose the DNS response code. The common `gethostbyname()` family of functions does not, and nor (AFAICR) does the newer `getaddrinfo()` – Alnitak Aug 02 '16 at 22:14
  • @Alnitak Yet it does not seem to be a problem in practice. There recently was a major downtime with several domains that had all their nameservers down, yet mail was still queued and delivered afterwards. During the outage, a `dig` on the domain resulted in `ServFail`, which the mail servers seem to have picked up. – Ruben Verborgh Aug 03 '16 at 17:27
5

The conventional wisdom is to have two nameservers for redundancy. Ideally, this keeps downstream name servers pointed in the right place even if, say, your colo is unreachable. If you are hosting these websites from your home, your weak link will probably be your connection or power, not the machines themselves (assuming you are using servers, and not repurposed desktops). Also, since you are hosting from your home, I'm assuming that high availability is not a requirement.

However, you need to make absolutely sure that you have a static IP address, as you will not be able to register a dynamic IP with the root servers. This means that, if your IP changes, they will be pointing everyone to the wrong place to look for the correct IP for your machines.

Ben Doom
  • 684
  • 3
  • 6
  • 1
    Another point to make here in the way of security: if you attempt to host DNS with a non-static IP address, and another savvy user later acquires your prior IP address, they can receive the lookup requests for your web site, serve up different results, and send visitors to a different place. Always go with a 100% static IP. – Brian Cline Nov 08 '09 at 02:36
  • I do have a static ip address –  Nov 08 '09 at 05:05
4

I have been using EveryDNS for my primary host. My domain is not setup this way, but they do offer secondary service for free. This would allow you to get a redundant nameserver on a different network and still setup BIND on your own.

Alex
  • 6,477
  • 1
  • 23
  • 32
  • 1
    +1 Works wonders... I don't see the point in hosting the name servers yourself at all. I migrated from free Zoneedit+DynDNS to EveryDNS recently and am very pleased, so much so I immediately donated and intend to continue doing on a yearly basis. – Oskar Duveborn Nov 08 '09 at 15:14
1

Many times your domain registar will also offer DNS services included with the DNS registeration. So the domains I have registered at GoDaddy and Network solutions both use their DNS and it doesn't cost any extra.

SpaceManSpiff
  • 2,547
  • 18
  • 19
1

XName provides free DNS hosting. You would be able to use any one of their name servers for your secondary server.

Ed.
  • 416
  • 2
  • 8
0

DNS requires a MINIMUM of two servers. You can have as many as 13 unique IP addresses with DNS servers for your domains, and if you run an anycast network, you can put hundreds of DNS servers behind each address.

But for a small site it is best to start with two DNS servers on two differen networks, and work up from there.

If you go to Google and use the search string "secondary dns" free you will find a number of organizations offering free secondary or backup DNS. They may also want you to provide free secondary DNS for them, kind of you scratch my back and I'll scratch yours.

It is a good idea to find three or more such arrangements because circumstances change over time.

Michael Dillon
  • 1,809
  • 13
  • 16
0

Plenty of domain registrars do NOT require 2 DNS servers (last I checked - for example NameBargain.com). So if your registrar requires this, shop around.

If you have a static IP address, and you are going to host everything (web, DNS, etc.) on the same single IP address / connection/ box anyway, then the RFC requirement for two DNS servers is really overkill. If your server or connection goes down, then it really doesn't matter that you have a functional DNS server somewhere else.

Jesper
  • 914
  • 7
  • 4