DNS
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsSystem AdministrationDNS

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
Stop making mediocre tutorials.The best tutorials are video! Camtasia Studio makes it easy to create engaging, buzz-building screen videos at any size, in any popular format. Download the free trial!
  #1  
Old September 9th, 2003, 09:53 AM
moogman moogman is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jul 2003
Posts: 47 moogman User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 5
dns dual server question

If I have two servers with two different ip addresses and both servers are the same site, will both computers serve the site in tandem if I have the ns1 pointing at one ip and ns2 pointing at the other? How would this need to be set up to work?

Reply With Quote
  #2  
Old September 9th, 2003, 02:13 PM
Prime Mover Prime Mover is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Aug 2003
Location: Jersey
Posts: 64 Prime Mover User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 5
Nope, what you prooposed will not work for what you want to achieve.

Basically, the secondary DNS server is used only if the primary can't be reached (or unless another nameserver gets the secondary in its cache for some reason).

You'll end up having all your DNS served out by the first server, and your first IP will take all the hits.

You're looking at a load-balancing solution. For true load-balancing, you need the right equipment, which can get expensive.

However, the cheap but not-so-perfect alternative, is round-robin DNS. Basically, the idea is that the servers IP's will get served by DNS in round-robin fashion, i.e. the first requested lookup will be the first DNS entry, the second requested lookup will be the second entry, and so forth and so on. You can have more than 2 entries, and each will get served in succession.

In BIND 8, you simply add A records for each IP in your zone file like so:

server1.yourdomain.com IN A 192.168.0.1
server2.yourdomain.com IN A 192.168.0.2

and so on.

That's it. Reload zone, have a nice day.

-Gary

Reply With Quote
  #3  
Old September 9th, 2003, 03:14 PM
Scorpions4ever's Avatar
Scorpions4ever Scorpions4ever is offline
Banned ;)
Dev Shed God 5th Plane (7000 - 7499 posts)
 
Join Date: Nov 2001
Location: Glendale, Los Angeles County, California, USA
Posts: 7,391 Scorpions4ever User rank is Major General (70000 - 90000 Reputation Level)Scorpions4ever User rank is Major General (70000 - 90000 Reputation Level)Scorpions4ever User rank is Major General (70000 - 90000 Reputation Level)Scorpions4ever User rank is Major General (70000 - 90000 Reputation Level)Scorpions4ever User rank is Major General (70000 - 90000 Reputation Level)Scorpions4ever User rank is Major General (70000 - 90000 Reputation Level)Scorpions4ever User rank is Major General (70000 - 90000 Reputation Level)Scorpions4ever User rank is Major General (70000 - 90000 Reputation Level)Scorpions4ever User rank is Major General (70000 - 90000 Reputation Level)Scorpions4ever User rank is Major General (70000 - 90000 Reputation Level)Scorpions4ever User rank is Major General (70000 - 90000 Reputation Level)Scorpions4ever User rank is Major General (70000 - 90000 Reputation Level)Scorpions4ever User rank is Major General (70000 - 90000 Reputation Level)Scorpions4ever User rank is Major General (70000 - 90000 Reputation Level) 
Time spent in forums: 4 Weeks 1 Day 7 h 54 m 14 sec
Reputation Power: 715
Quote:
Originally posted by Prime Mover
Nope, what you prooposed will not work for what you want to achieve.

Basically, the secondary DNS server is used only if the primary can't be reached (or unless another nameserver gets the secondary in its cache for some reason).

You'll end up having all your DNS served out by the first server, and your first IP will take all the hits.

The above statements are complete and utter balderdash. That's NOT how name resolution works. When looking up a domain name, a caching name resolver will pick one of your nameservers at RANDOM. It doesn't know (or care) which is primary, secondary, tertiary or whatever -- it'll just pick one at random and query it. If no response comes back, then it'll pick another one and so on. This primary-secondary business only applies to your nameservers when you decide which one is master and which one(s) is slave. The rest of the outside world couldn't care less.

Quote:
Originally posted by Prime Mover

You're looking at a load-balancing solution. For true load-balancing, you need the right equipment, which can get expensive.

First statement is true. Second statement is not necessarily true -- you can google for Linux Load Balancing (http://lcic.org/load_balancing.html is one such project) and find some cheaper alternatives. For the record, we use a hardware solution at work though

Quote:
Originally posted by Prime Mover

However, the cheap but not-so-perfect alternative, is round-robin DNS. Basically, the idea is that the servers IP's will get served by DNS in round-robin fashion, i.e. the first requested lookup will be the first DNS entry, the second requested lookup will be the second entry, and so forth and so on. You can have more than 2 entries, and each will get served in succession.

In BIND 8, you simply add A records for each IP in your zone file like so:

server1.yourdomain.com IN A 192.168.0.1
server2.yourdomain.com IN A 192.168.0.2

and so on.

That's it. Reload zone, have a nice day.

-Gary

I think you really mean:
server.yourdomain.com IN A 192.168.0.1
server.yourdomain.com IN A 192.168.0.2

BTW this isn't really a round-robin solution because of caching. Let's say an AOL user decides to visit server.yourdomain.com. Their caching nameresolver will query your nameserver and receive a result (let's say 192.168.0.1). Now let's say another AOL user decides to visit server.yourdomain.com. The caching nameresolver is not going to requery your nameserver for a while. Instead, it returns the cached result from the first time around. The information is going to be cached for a while, so a lot of hits could go to one webserver rather than the other. Also see http://www.menandmice.com/online_do...oad.sharing.htm for some potential pitfalls.

One more thing to note is that if the caching nameserver is dnscache (which is what we use at work) rather than BIND. See http://marc.theaimsgroup.com/?t=104483126300004&r=1&w=2
__________________
Up the Irons
What Would Jimi Do? Smash amps. Burn guitar. Take the groupies home.
"Death Before Dishonour, my Friends!!" - Bruce D ickinson, Iron Maiden Aug 20, 2005 @ OzzFest
Down with Sharon Osbourne

Puzzle of the Month solved by sizeablegrin, etienne141 and L7Sqr, superior C/C++ programmers of the month

Last edited by Scorpions4ever : September 9th, 2003 at 03:25 PM.

Reply With Quote
  #4  
Old September 9th, 2003, 04:10 PM
moogman moogman is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jul 2003
Posts: 47 moogman User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 5
two servers

So in other words the way I was talking about may work? Two servers, 2 different static ips, and have the dns pointing to each one. I already have one up and running fine with bind, would the other just be a identical bind except for the ip?

Reply With Quote
  #5  
Old September 9th, 2003, 04:33 PM
alexgreg's Avatar
alexgreg alexgreg is offline
Full Access
Dev Shed Regular (2000 - 2499 posts)
 
Join Date: Jun 2000
Location: London, UK
Posts: 2,019 alexgreg User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 3 sec
Reputation Power: 11
Quote:
I already have one up and running fine with bind, would the other just be a identical bind except for the ip?

Yes. You'll need to do zone transfers every so often to keep them in sync.
__________________
Alex
(http://www.alex-greg.com)

Reply With Quote
  #6  
Old September 9th, 2003, 04:57 PM
moogman moogman is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jul 2003
Posts: 47 moogman User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 5
zone transfers?

What do you mean zone transfers?

Reply With Quote
  #7  
Old September 9th, 2003, 05:02 PM
alexgreg's Avatar
alexgreg alexgreg is offline
Full Access
Dev Shed Regular (2000 - 2499 posts)
 
Join Date: Jun 2000
Location: London, UK
Posts: 2,019 alexgreg User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 3 sec
Reputation Power: 11
http://www.menandmice.com/online_do...ne.transfer.htm

They're a sucky way of synchronising DNS server information - unfortunately they're the only mechanism that BIND provides for doing this.

BIND sucks, incidentally. You should look at djbdns - a far more secure and robust solution.

Reply With Quote
  #8  
Old September 9th, 2003, 05:17 PM
moogman moogman is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jul 2003
Posts: 47 moogman User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 5
zone transfers

unfortunally I am using apache on xp, thats why I using bind. Is there some documentation somwhere on zone transfers? I still do not understand what your referring for me to do with the zone, I know how to set it up on the other computer to work with the new Ip once I get it.

Reply With Quote
  #9  
Old September 9th, 2003, 05:25 PM
alexgreg's Avatar
alexgreg alexgreg is offline
Full Access
Dev Shed Regular (2000 - 2499 posts)
 
Join Date: Jun 2000
Location: London, UK
Posts: 2,019 alexgreg User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 3 sec
Reputation Power: 11
Quote:
unfortunally I am using apache on xp, thats why I using bind.

Gah! OK, then.
Quote:
Is there some documentation somwhere on zone transfers?

Plenty:
http://www.google.com/search?q=%22z...=utf-8&oe=utf-8
(the first item in the list is the djbdns site saying how poor zone transfers are - how ironic)
Quote:
I still do not understand what your referring for me to do with the zone, I know how to set it up on the other computer to work with the new Ip once I get it.

What about when you add another host on the master DNS server, or change a DNS record? How is the slave server supposed to know about this change? That's the problem that zone transfers have attempted to solve - the slaves check with the primaries for new data every so often.

Reply With Quote
  #10  
Old September 9th, 2003, 05:38 PM
moogman moogman is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jul 2003
Posts: 47 moogman User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 5
oh

I guess I was thinking once I assigned the 2nd ip with network solutions and changed my zone file in 2nd computer to reflect the new ip that if the first one was busy it would go to 2nd ip address.

Reply With Quote
  #11  
Old September 9th, 2003, 05:41 PM
alexgreg's Avatar
alexgreg alexgreg is offline
Full Access
Dev Shed Regular (2000 - 2499 posts)
 
Join Date: Jun 2000
Location: London, UK
Posts: 2,019 alexgreg User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 3 sec
Reputation Power: 11
Quote:
if the first one was busy it would go to 2nd ip address.

No, this is wrong - as explained by Scorpions4ever, resolvers will choose an authorative nameserver for your domain at random to query.

Reply With Quote
  #12  
Old September 9th, 2003, 05:53 PM
moogman moogman is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jul 2003
Posts: 47 moogman User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 5
if it picks it at random

if it does that should it not work back and forth between them depending on which one it picks?

Reply With Quote
  #13  
Old September 9th, 2003, 05:59 PM
moogman moogman is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jul 2003
Posts: 47 moogman User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 5
reading your link

I am reading the link you posted, now it makes a little bit more sense

Reply With Quote
Reply

Viewing: Dev Shed ForumsSystem AdministrationDNS > dns dual server question


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump