LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Server
User Name
Password
Linux - Server This forum is for the discussion of Linux Software used in a server related context.

Notices


Reply
  Search this Thread
Old 12-27-2010, 06:04 PM   #1
aljo1985
LQ Newbie
 
Registered: Dec 2010
Posts: 3

Rep: Reputation: 0
Unhappy Bind dns problem


Hi,

I have 2 IP addresses...
My VPS is running Centos with Webmin + Virtualmin
Custom modded to work effectively

My problem is.. On My PS3 I use one of the IP addresses to redirect content so I can stream music and videos via my VPS

Simple By inputting my IP on the PS3 DNS setting and configuring bind to redirect requests in bind to apache.

Thing is.. I wanna use the other IP address..
In bind..
I basically wanna say IF request comes from IP number 1 then redirect to domain number 1 in Apache

If request from IP Number 2 then redirect to Domain number 2 in apache..

I can only create one master record and put the A address to point to one or both IP addresses..

But then the PS3 asks for content from both IP addresses and crashes.

How would I separate it so that when I put one IP address in my ps3 it would send requests from that IP address to only 1 Apache server not both of them set up.

The goal is.. I can have 2 different redirects on 2 IP addresses.
So I could connect to one and use that content from 1 IP but then I could also change the IP in my PS3 to connect to the other and have other content..

I hope I explained it well enough..

The simple thing is.. I create a master record with A name directed to my IP address..
I can only create one.. I dunno how to seperate it so that there is no clash.
Or to say IF from IP 1 goto Apache 1

Please Help!
 
Old 12-27-2010, 09:45 PM   #2
Noway2
Senior Member
 
Registered: Jul 2007
Distribution: Gentoo
Posts: 2,125

Rep: Reputation: 781Reputation: 781Reputation: 781Reputation: 781Reputation: 781Reputation: 781Reputation: 781
Quote:
I basically wanna say IF request comes from IP number 1 then redirect to domain number 1 in Apache
If request from IP Number 2 then redirect to Domain number 2 in apache..
My initial thought is that this might be better or at least easier to accomplish with IPTables and NAT. See the following link for some examples. The advantage of IPtables is that you can specify the source and destination address and port, which it sounds like you are after.
 
Old 12-27-2010, 11:18 PM   #3
aljo1985
LQ Newbie
 
Registered: Dec 2010
Posts: 3

Original Poster
Rep: Reputation: 0
Yeah I think so.

In short I basically have 2 ip addresses and one domain name that the IP addresses have to resolve to.
When one IP address is used to resolve to the domain and the request for the file is sent to apache all is fine..
Thing is How would I use the OTHER IP address so that it can resolve the same domain name but redirected to the OTHER IP and goto a different path in apache.

I know I have to create the A records and define the IP addresses that they need to be directed to.
But I can only use one IP address and have the requests directed to one IP address.

I need them so it would act like 2 different servers and both would direct to 2 diff locations in apache.

--------------------------------------------------------------------------------------------------------------


example

PS3 Setup 1
111.111.111.111 << IP of server

Bind Setup 1
DOMAIN.COM A 111.111.111.111

APACHE DIRECTORY
/FOLDER1/
----------------------------------------------------------
PS3 Setup 2
222.222.222.222 << IP of server

Bind Setup 1
DOMAIN.COM A 222.222.222.222

APACHE DIRECTORY
/FOLDER2/

1 domain is what I have
Thing is how would I define that a call was made from either of the IP addresses and to redirect to different apache directories based off what settings I input in my PS3

Hence being able to change the IP address and the content would be different.

The only way I know it would work is if I have 2 vps server and I could then have 2 a records using the same domain name and redirecting to one IP address on them both..

I just can't find out how I would do this without having to have 2 binds.

Hope its explained well..
Yeah I have virtual hosts set up.. Its bind that I am having the problem with.. I just can't actually think or work out a method todo this.

EDIT I have apache set up so that the IP addresses I have goto different locations.
But I can't get bind to redirect the calls from each IP depending on what IP address I have on my PS3



ALSO:
TBH I dunno much about IP tables and NAT..
Could u give me an example. Plus is this achievable?
Thank you for your reply appreciated.
 
Old 12-27-2010, 11:24 PM   #4
aljo1985
LQ Newbie
 
Registered: Dec 2010
Posts: 3

Original Poster
Rep: Reputation: 0
Another thing I have that maybe an issue.

When the PS3 makes a request for a file obvious the request will hit the server 1st.
THE IP in the PS3 DNS Settings will be the IP address of the server
But I'm thinking how would the server know what DNS setting is in the PS3 as wouldn't the server only know what IP is asking for the request
IE My IP.

Or does NAT or IPTABLES filter all that as there is more information such as referrer and such.
Sorry for being so noob..

Just really wanna accomplish this task.
 
Old 12-29-2010, 09:31 AM   #5
bzboy88
LQ Newbie
 
Registered: Dec 2010
Posts: 11

Rep: Reputation: 0
In you bind setup instead of just using DOMAIN.COM A x.x.x.x for both DNS records, why dont you use music.DOMAIN.com A 1.1.1.1 and video.domain.com A 2.2.2.2. That way you can separate the the requests so that they resolve to two different IP Addresses on the same server. You won't have to mess with IP Tables or NAT it will all be handled by your DNS Server based on the request made by the PS3.

Then on your PS3 you put in the music.DOMAIN.com in the music folder and video.DOMAIN.com for the video folder so that request the correct APACHE folder and then you will not have one request going to both IP's and failing out.

Last edited by bzboy88; 12-29-2010 at 09:36 AM.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
DNS/BIND problem postisper Linux - Server 3 11-26-2008 01:19 AM
Bind 9.4.3 and 2 hr DNS flooding problem branfarm Linux - Server 6 09-07-2008 12:53 PM
Problem on DNS server using Bind r_balest Linux - Server 9 11-02-2006 02:06 AM
DNS / Bind Problem.... Sapient Linux - Networking 66 01-18-2006 05:28 AM
dns or bind problem please help! latehit Linux - Networking 4 12-12-2002 04:51 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Server

All times are GMT -5. The time now is 09:37 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration