Article delegate-en/4391 of [1-5169] on the server localhost:119
  upper oldest olders older1 this newer1 newers latest
search
[Top/Up] [oldest] - [Older+chunk] - [Newer+chunk] - [newest + Check]

Newsgroups: mail-lists.delegate-en

[DeleGate-En] wildcard support using Delegate as DNS server
09 Mar 2009 23:01:54 GMT Guillaume de Rorthais <pe4iqbdyi-kvvvzvfz4r3r.ml@ml.delegate.org>


Hi Yutaka Sato,

I am trying to set up Delegate as a DNS server with domain wildcard support.

I use the following config:
-P"127.0.0.1:5353"
-vv
-dhst
SERVER=dns
DNSCONF=domain:domain.com,origin:ns1,para:1
RESOLV=file:/usr/local/delegate/etc/dns.db
DGROOT=/usr/local/delegate/var
TMPDIR=/usr/local/delegate/var/dns
LOGFILE='dns-${PROTO}.log'
PROTOLOG='dns-${PROTO}.log'
REMITTABLE="dns/{5353,53}"
PERMIT="dns:*:*"

with the following /usr/local/delegate/etc/dns.db :
a.a.a.a domain.com
a.a.a.b test1.domain.com
a.a.a.c test2.domain.com
a.a.a.a *.domain.com

With the current stable Delegate code, using the following command :
# dig @127.0.0.1 -p 5353 test1.domain.com

I got 2 A records:
test1.domain.com 21600 IN    A       a.a.a.b
test1.domain.com 21600 IN    A       a.a.a.a

I had the same result with the following dns.db:
a.a.a.a domain.com *.domain.com
a.a.a.b test1.domain.com
a.a.a.c test2.domain.com

I read many time the Manual, trying many different solutions (with HOSTS 
as instance), but I couldn't make it works.

As the Manual says that current DNS server doesn't support CNAME in the 
serv_DNS part, I wonder if there's a way to simulate it.

It seems to me, the best way to support it would be to add alias names 
from a hosts file as CNAME entries. This way, a line like:
a.a.a.a domain.com *.domain.com

would means:
domain.com IN A a.a.a.a
*.domain.com IN CNAME a.a.a.a

I hadn't many time to investigate further, but I tried the following 
patch to handle my issue:
########################################################################
diff -rc --ignore-space delegate9.9.1/resolvy/reshost.c 
delegate/resolvy/reshost.c
*** delegate9.9.1/resolvy/reshost.c     2008-12-24 20:42:31.000000000 -0500
--- delegate/resolvy/reshost.c  2009-03-09 17:39:18.000000000 -0400
***************
*** 918,923 ****
--- 918,925 ----
         for( lp = hp->h_buff; leng = (lp[0]<<8|lp[1]&0xFF); lp += leng+3 ){
                 ac += 
RES_matchLine(path,byname,name,lp+2,rrc-ac,&rv[ac],AVStr(rb),AVStr(cname));
                 rb = rv[ac];
+               if (ac)
+                       break;
         }
         return ac;
   }
########################################################################

I understand it is highly touchy and probably break or make Delegate act 
uncorreclty, but at least, it stop parsing the entries at the first match.

Your expertise and feedback on this issue would be greatly appreciated.

Thanks in advance,

-- 
Guillaume (ioguix) de Rorthais


  admin search upper oldest olders older1 this newer1 newers latest
[Top/Up] [oldest] - [Older+chunk] - [Newer+chunk] - [newest + Check]
@_@V