I am performing an assignment named DNS filtering. For that I compiled djbdns-1.05 source code. I have maintained my data using constant database (cdb) file named as "cdbDomainList.cdb" in root.
Also I have configured dnscache using localhost.
But, I am struggling whenever I am going to open that "cdbDomainList.cdb" file inside query.c file. My logic is :
int fd;
fd = open("/root/cdbDomainList.cdb", O_RDWR);
if(fd == -1){
printf("Error while opening cdbDomainList.cdb.\n");
return EXIT_FAILURE;
}
cdbDomainList.cdb file is present at given path But, still While running dnscache, always I am getting "Error while opening cdbDomainList.cdb.".
I have tried with O_RDONLY flag also still same results.
I am expecting some intelligent suggestions. Thanks in advance.