Find the answer to your Linux question:
Results 1 to 7 of 7
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 ...
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1
    Just Joined!
    Join Date
    Dec 2010
    Posts
    3

    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!

  2. #2
    Linux Guru Lazydog's Avatar
    Join Date
    Jun 2004
    Location
    The Keystone State
    Posts
    2,677
    Bind does one thing and one thing only, that is convert host name to ip address or ip address to host name. It doesn't do any redirecting. If you are looking to redirect things then maybe you should be looking into IPTABLES and ports. Or give examples of what you are looking to do because the way you explained it above isn't clear.

    Regards
    Robert

    Linux
    The adventure of a life time.

    Linux User #296285
    Get Counted

  3. #3
    Just Joined!
    Join Date
    Dec 2010
    Posts
    3
    Quote Originally Posted by Lazydog View Post
    Bind does one thing and one thing only, that is convert host name to ip address or ip address to host name. It doesn't do any redirecting. If you are looking to redirect things then maybe you should be looking into IPTABLES and ports. Or give examples of what you are looking to do because the way you explained it above isn't clear.

    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

    Code:
    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

    I do wanna resolve domain names into IP addresses.
    But I I put one of my ip addresses in my PS3 I want it to resolve to the same domain, but depending on what IP address I put in my PS3 depends on where it gets the content from.

    I don't know much about IP tables.
    Last edited by MikeTbob; 01-15-2011 at 04:53 PM. Reason: Added Code Tags

  4. $spacer_open
    $spacer_close
  5. #4
    Linux Guru Lazydog's Avatar
    Join Date
    Jun 2004
    Location
    The Keystone State
    Posts
    2,677
    A domain can have many A records assigned to it. If your Domain is DOMAIN.COM then you just add A records to that domain. i.e.,

    Code:
    serv1        A    111.111.111.111
    serv2        A    222.222.222.222
    Then when you access serv2 you are directed to 222.222.222.222
    Or when you access serv1 you are directed to 111.111.111.111

    It really helps when you can give true domain names and an example of your zone file.

    Regards
    Robert

    Linux
    The adventure of a life time.

    Linux User #296285
    Get Counted

  6. #5
    Just Joined!
    Join Date
    Dec 2010
    Posts
    3
    That's the problem.. When I do put both A records to redirect to both IP addresses.

    It don't work to good it crashes my PS3.
    Because its requesting the same content from both IP addresses.

    The think I am trying to do is say if 111 address is in the PS3 then redirect to 111

    if 222 is in my ps3's DNS then redirect to 222

    I can't have both A records in bind as it crashes.

    But yeah it looks like ur example
    but serve 1 would be the same domain.
    so it would be serv1 for 111 and serv1 for 222

  7. #6
    Linux Guru Lazydog's Avatar
    Join Date
    Jun 2004
    Location
    The Keystone State
    Posts
    2,677
    Bind is not at fault here. It is doing exactly what it is supposed to do.
    Requests for Serv1 get address 1.
    Requests for Serv2 get address 2.

    I believe the problem is not bind but your interpretation of what you believe should work. If you want help then you are going to have to help by giving a network layout and how things are connected. Then you are going to have to explain what it is you are trying to do and what programs you are using.

    Regards
    Robert

    Linux
    The adventure of a life time.

    Linux User #296285
    Get Counted

  8. #7
    Just Joined!
    Join Date
    Dec 2009
    Location
    California
    Posts
    98
    I am still not 100% sure what you want, however, I think what you are saying is that you would like BIND to respond with a different answer depending on which IP address the query comes from.
    This is definitely possible. You need to use views.

    In my named.conf, I have this:
    -----
    Code:
    acl "unixpeople" {
            192.168.37/24;
            127.0.0.1;
    };
    
    view "internal" {
            match-clients { unixpeople; };
    
        zone "unixpeople.com" {
             type master;
             /* file "db.unixpeople.signed"; */
             file "data/db.unixpeople";
             allow-update {key dynupdates;};
        };
    }; /* end internal view */
    
    view "external" {
            match-clients { any; };
    
            zone "unixpeople.com" {
                    type master;
                    /* file "db.unixpeople.signed"; */
                    file "data/db.unixpeople";
                    allow-update {key dynupdates;};
            };
    }; /* end external view */
    -------------


    It should be evident that the acl entry defines the list of clients - you'd put the IP address of your PS3 in there,
    then bind will look at the IP of the machine making the query and respond with the content of the internal zone when the PS3 makes the request.
    Last edited by MikeTbob; 01-15-2011 at 04:53 PM. Reason: Added Code Tags

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •