LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 02-04-2012, 04:34 AM   #1
hermy7
LQ Newbie
 
Registered: Dec 2011
Location: Syd
Distribution: Centos, Red hat
Posts: 25

Rep: Reputation: Disabled
Smile geoDNS


Hi guys, I'm trying to configure geodns using bind on linux..
I have download the geoIP.acl and
configure the /etc/named.conf
the script..


include "/path/to/GeoIP.acl";
view "north_america" {
match-clients { US; CA; MX; };
recursion no;
zone "example555.com" {
type master;
file "/var/named/example555.com";
};
};


but it do not work..
anyone can help out.
thanks.
 
Old 02-04-2012, 09:31 AM   #2
bathory
LQ Guru
 
Registered: Jun 2004
Location: Piraeus
Distribution: Slackware
Posts: 11,521

Rep: Reputation: 1502Reputation: 1502Reputation: 1502Reputation: 1502Reputation: 1502Reputation: 1502Reputation: 1502Reputation: 1502Reputation: 1502Reputation: 1502Reputation: 1502
Hi,

Could you specify what you mean by: "but it do not work"?
I guess you've followed the instructions here and have created the different views needed and of course the different zone files (one for each view).

Regards
 
Old 02-16-2012, 01:08 PM   #3
hermy7
LQ Newbie
 
Registered: Dec 2011
Location: Syd
Distribution: Centos, Red hat
Posts: 25

Original Poster
Rep: Reputation: Disabled
Sorry for the late replay bathory. yup you are right. I was follow that link coz I don't have idea how implement geoDNS in linux. I have try implement geoDNS using simpleDNS on windows it was quite easy. But for linux I don't find enough sample for implementation hope you can help out for the resources or any references. Thanks.

best regards,
hermy
 
Old 02-16-2012, 02:04 PM   #4
bathory
LQ Guru
 
Registered: Jun 2004
Location: Piraeus
Distribution: Slackware
Posts: 11,521

Rep: Reputation: 1502Reputation: 1502Reputation: 1502Reputation: 1502Reputation: 1502Reputation: 1502Reputation: 1502Reputation: 1502Reputation: 1502Reputation: 1502Reputation: 1502
Hi,
Quote:
But for linux I don't find enough sample for implementation hope you can help out for the resources or any references.
You didn't mentioned your distro and bind version, or post your config, but in any case there is nothing fancy in using GeoDNS in bind.
You have to run the script to create the GeoIP.acl file containing IPs and locations.
Then as mentioned in its website you need to add in /etc/named.conf:
Code:
include "/path/to/GeoIP.acl";

view "north_america" {
  match-clients { US; CA; MX; };
  recursion no;
  zone "example555.com" {
    type master;
    file "pri/example555-north-america.db";
  };
};

view "south_america" {
  match-clients { AR; CL; BR; PY; PE; EC; CO; VE; BO; UY; };
  recursion no;
  zone "example555.com" {
    type master;
    file "pri/example555-south-america.db";
  };
};

view "other" {
  match-clients { any; };
  recursion no;
  zone "example555.com" {
    type master;
    file "pri/example555-other.db";
  };
};
And you should create the 3 zone files (one for each view). E.g.
Code:
;pri/example555-north-america.db
$TTL 86400      ; 1 day
@               IN SOA localhost. root.localhost. (
                  2012021601 ; serial
                  28800      ; refresh (8 hours)
                  7200       ; retry (2 hours)
                  604800     ; expire (1 week)
                  86400      ; minimum (1 day)
                  )

                  NS      localhost.

host1         A         1.1.1.1
host2         A         1.1.1.2
Code:
;pri/example555-south-america.db
$TTL 86400      ; 1 day
@               IN SOA localhost. root.localhost. (
                  2012021601 ; serial
                  28800      ; refresh (8 hours)
                  7200       ; retry (2 hours)
                  604800     ; expire (1 week)
                  86400      ; minimum (1 day)
                  )

                  NS      localhost.

host1         A         2.2.2.1
host2         A         2.2.2.2
Code:
;pri/example555-other.db
$TTL 86400      ; 1 day
@               IN SOA localhost. root.localhost. (
                  2012021601 ; serial
                  28800      ; refresh (8 hours)
                  7200       ; retry (2 hours)
                  604800     ; expire (1 week)
                  86400      ; minimum (1 day)
                  )

                  NS      localhost.

host1         A         3.3.3.1
host2         A         3.3.3.2
 
1 members found this post helpful.
Old 02-17-2012, 01:57 AM   #5
hermy7
LQ Newbie
 
Registered: Dec 2011
Location: Syd
Distribution: Centos, Red hat
Posts: 25

Original Poster
Rep: Reputation: Disabled
Smile

Bathory thanks for the code but unfortunately it was failed when I run it.
can you let me know in which parts that I did wrong.

/etc/init.d/named start

Code:
starting named:
Error in named configuration:
zone test.com/IN: loading master file tmp/america.db: file not found
north_america/test.com/IN: file not found
zone test.com/IN: loaded serial 2012021601               failed

vi /etc/named.conf

Code:
include "/path/to/GeoIP.acl";

view "north_america" {
  match-clients { US; CA; MX; };
  recursion no;
  zone "test.com" {   changes this line
    type master;
    file "tmp/america.db";    changes this line
  };
};

view "other" {
  match-clients { any; };
  recursion no;
  zone "test.com" {    changes this line
    type master;
    file "tmp/others.db";    changes this line
  };
};
vi /tmp/america.db

Code:
;tmp/america.db
$TTL 86400      ; 1 day
@        IN SOA   ns.test.com test.com. (  changes this line
                  2012021601 ; serial
                  28800      ; refresh (8 hours)
                  7200       ; retry (2 hours)
                  604800     ; expire (1 week)
                  86400      ; minimum (1 day)
                  )

                  NS      ns.test.com      changes this line

host1         A         10.10.20.2        changes this line
vi /tmp/others.db

Code:
;tmp/others.db
$TTL 86400      ; 1 day
@        IN SOA   ns.test.com test.com. (    changes this line
                  2012021601 ; serial
                  28800      ; refresh (8 hours)
                  7200       ; retry (2 hours)
                  604800     ; expire (1 week)
                  86400      ; minimum (1 day)
                  )

                  NS      ns.test.com     changes this line

host1         A         10.10.30.2       changes this line
I run this on CentOS 5.5 under VMware
for test I will used windows xp and changes to US IP and randome IP.
thanks.
 
Old 02-17-2012, 03:25 AM   #6
bathory
LQ Guru
 
Registered: Jun 2004
Location: Piraeus
Distribution: Slackware
Posts: 11,521

Rep: Reputation: 1502Reputation: 1502Reputation: 1502Reputation: 1502Reputation: 1502Reputation: 1502Reputation: 1502Reputation: 1502Reputation: 1502Reputation: 1502Reputation: 1502
Hi,

I can only guess you''re running named chrooted. The default chroot jail in centso is /var/named, so if you didn't change it, the zone files should be located under /var/named/tmp

Regards
 
Old 02-17-2012, 03:26 AM   #7
hermy7
LQ Newbie
 
Registered: Dec 2011
Location: Syd
Distribution: Centos, Red hat
Posts: 25

Original Poster
Rep: Reputation: Disabled
got it..

finally solve the problem...
I miss / on /etc/named.conf file "tmp/america.db";

and changes some on Zone file

Code:
;tmp/america.db
$TTL 86400      ; 1 day
@        IN SOA   ns.test.com test.com. ( 
                  2012021601 ; serial
                  28800      ; refresh (8 hours)
                  7200       ; retry (2 hours)
                  604800     ; expire (1 week)
                  86400      ; minimum (1 day)
                  )

       IN    NS      ns.test.com    

       IN A         10.10.20.2       
www    IN A         10.10.20.2

Code:
;tmp/others.db
$TTL 86400      ; 1 day
@        IN SOA   ns.test.com test.com. ( 
                  2012021601 ; serial
                  28800      ; refresh (8 hours)
                  7200       ; retry (2 hours)
                  604800     ; expire (1 week)
                  86400      ; minimum (1 day)
                  )

       IN    NS      ns.test.com    

       IN A         10.10.30.2       
www    IN A         10.10.30.2
Thanks again for your help..
cheers...
 
Old 02-17-2012, 03:33 AM   #8
bathory
LQ Guru
 
Registered: Jun 2004
Location: Piraeus
Distribution: Slackware
Posts: 11,521

Rep: Reputation: 1502Reputation: 1502Reputation: 1502Reputation: 1502Reputation: 1502Reputation: 1502Reputation: 1502Reputation: 1502Reputation: 1502Reputation: 1502Reputation: 1502
Cool!!
You may mark the thread "Solved" from the Thread Tools on top of the page

Cheers
 
  


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
GeoDNS, is it real and in use? sir-lancealot Linux - Server 1 09-01-2010 04:02 PM


All times are GMT -5. The time now is 08:21 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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration