DNSSEC - Ad Flag not activated

724

Solution 1

You won't. AD is not set by authoritative servers, only recursive resolvers which have validated the chain of trust. I know that seems stupid, since the authoritative server has the keys - but that's how it is.

Solution 2

Per user53814's answer, you won't get the AD bit from an authoritative server. This is by design - just because the server has keys doesn't prove it has the right keys.

Your recursive resolver will perform validation, but it won't send back the AD bit unless the client has indicated DNSSEC awareness by sending the DO bit in the query (i.e. with the +dnssec option to dig). This is how DNSSEC maintains backwards compatibility, by ensuring that unexpected DNSSEC data isn't sent to clients that aren't expecting it.

Note however that your validating recursive resolver will still indicate validation failure by returning a SERVFAIL error code. Hence a stub that is not DNSSEC-aware can still be protected from receiving bad answers just by talking to a a DNSSEC-aware recursor.

Solution 3

I had the same problem. And solved it by updating to the bind contained in Debian jessie (1:9.9.5.dfsg-7) and put the following in dnssec-validation auto; in /etc/bind/named.conf.options. Now the ad flag is set for all but the authoritative domains.

Share:
724

Related videos on Youtube

user2260521
Author by

user2260521

Updated on September 17, 2022

Comments

  • user2260521
    user2260521 almost 2 years

    I want my annotations in two colors. For that I have used following code,

    - (MKAnnotationView *)mapView:(MKMapView *)sender viewForAnnotation:(id <MKAnnotation>)annotation {  
        static NSString *identifier = @"MyLocation";
        if ([annotation isKindOfClass:[PlaceMark class]]) {
            MKPinAnnotationView *annotationView = [[MKPinAnnotationView alloc] initWithAnnotation:annotation reuseIdentifier:identifier];
            annotationView.enabled = YES;
            annotationView.canShowCallout = YES;
            @try {
                if (annotationView == nil) {
                    annotationView = [[MKPinAnnotationView alloc]
                                      initWithAnnotation:annotation
                                      reuseIdentifier:identifier];
                } else {
                    annotationView.annotation = annotation;
                    
                    if([[nsCenterOrOffice objectAtIndex:z] isEqualToString:@"C"])
                    {
                        annotationView.pinColor = MKPinAnnotationColorRed;
                    }
                    else 
                    {
                        annotationView.pinColor = MKPinAnnotationColorGreen;
                    }
                }
            }
            @catch (NSException *exception) {
                NSLog(@"nsCenterOrOffice exception = %@",exception);
            }
            return annotationView;
        }
        return nil;
    }
    

    But still I am not able to set desired color for desired annotation. Sometimes particular annotation pin color is red and sometimes it's green. I am not getting why this is happening. Can anybody help me ? Thanks...

    I rework on my code..this is my updated code

    MapAnnotation.h

        #import <MapKit/MapKit.h>
        #import <Foundation/Foundation.h>
    
        @interface MapAnnotation : MKPointAnnotation
        {
            NSString *title;
            NSString *subtitle;
            int dealLnk;
            float latitude;
            float longitude;
            
            CLLocationCoordinate2D coordinate;
        }
    
        @property (nonatomic, copy) NSString *title;
        @property (nonatomic, copy) NSString *subtitle;
        @property (nonatomic, assign) int dealLnk;
        @property (nonatomic, assign) float latitude;
        @property (nonatomic, assign) float longitude;
        @property (nonatomic, readonly) CLLocationCoordinate2D coordinate;
    
        - (id)initWithTitle:(NSString *)ttl subTitle:(NSString *)subttl dealLink:(int)dealLnk latitude:(float)latitude longitude:(float)longitude andCoordinate:(CLLocationCoordinate2D)c2d;
    @end
    

    MapAnnotation.m

    #import "MapAnnotation.h"
    
    @implementation MapAnnotation
    
    @synthesize title,subtitle,dealLnk,coordinate,latitude,longitude;
    
    - (id)initWithTitle:(NSString *)ttl subTitle:(NSString *)subttl dealLink:(int)z latitude:(float)latitude1 longitude:(float)longitude1 andCoordinate:(CLLocationCoordinate2D)c2d {
        title = ttl;
        subtitle = subttl;
        dealLnk =z;
        coordinate = c2d;
        longitude = longitude1;
        latitude = latitude1;
        
        return self;
    }
    @end
    

    And this is my implementation file

    -(void)startAddingAnnotation
    {
        @try {
            CLLocationCoordinate2D annotationCoord;
            
            z=0;
            for (int i=0; i < [nslatitude count] ; i++,z++)
            {
                
                MapAnnotation  *dealAnnotation   = [[MapAnnotation  alloc] init];
                
                dealAnnotation.dealLnk = z;
                annotationCoord.latitude =  (CGFloat) [[nslatitude objectAtIndex:i] floatValue];
                annotationCoord.longitude = (CGFloat)[[nslongitude objectAtIndex:i] floatValue];
                dealAnnotation.coordinate = annotationCoord;
                
                dealAnnotation.title = [nsCenterName objectAtIndex:i];
                dealAnnotation.subtitle = [nsCenterAddress objectAtIndex:i];
                
                NSLog(@"latitude = %f",dealAnnotation.latitude);
                NSLog(@"longitude = %f",dealAnnotation.longitude);
                
                NSLog(@"dealAnnotation.dealLnk = %d",dealAnnotation.dealLnk);
                NSLog(@"dz = %d",z);
                [mapView addAnnotation:dealAnnotation];
               
            }
            
        }
        @catch (NSException *exception) {
            
            NSLog(@"Exception = %@",exception);
        }
        
        cord.longitude = -112.05186;
        cord.latitude = 33.46577;
        
        MKCoordinateRegion region;
        region.center = cord;
        
        MKCoordinateSpan span = {.latitudeDelta = 1.0, .longitudeDelta = 1.0};
        region.span = span;
        
        [mapView setRegion:region];
        
        
    }
    
    #pragma mark - MapView_Delegate
    - (MKAnnotationView *)mapView:(MKMapView *)sender viewForAnnotation:(id <MKAnnotation>)annotation {
        
    
        MapAnnotation *annotation1 = (MapAnnotation *)annotation;
        z = annotation1.dealLnk;
        
          NSLog(@"annotation1.longitude = %f",annotation1.latitude);
          NSLog(@"annotation1.longitude = %f",annotation1.longitude);
        
        if(z<[nslatitude count])
        {
            MKAnnotationView *pinView = nil;
            static NSString *defaultPinID = @"pin1";
            
            pinView = (MKAnnotationView *)[mapView dequeueReusableAnnotationViewWithIdentifier:defaultPinID];
            
          
            if ( pinView == nil )
                pinView = [[MKAnnotationView alloc]
                           initWithAnnotation:annotation1 reuseIdentifier:defaultPinID];
            pinView.canShowCallout = YES;
            
            @try {
                
                if([[nsCenterOrOffice objectAtIndex:z] isEqualToString:@"C"])
                {
                    pinView.image = [UIImage imageNamed:@"flag1.png"];
                }
                else
                {
                    pinView.image = [UIImage imageNamed:@"flag2.png"];
                }
                pinView.annotation = annotation1;
                pinView.tag = [[nsCenterName objectAtIndex:z] intValue];
                
            }
            @catch (NSException *exception) {
                NSLog(@"nsCenterOrOffice exception = %@",exception);
            }
            
            UIButton *rightButton = [UIButton buttonWithType:UIButtonTypeDetailDisclosure];
            [rightButton setTitle:annotation.title forState:UIControlStateNormal];
            [pinView setRightCalloutAccessoryView:rightButton];
    
            return pinView;
        }
        else
        {
            return nil;
        }
        
    }
    

    Now the problem is, all the annotations are pointing some different location. I am not getting why this is happening? Is der anything wrong in my code?

    • Pratik
      Pratik almost 11 years
      did you check your condition [[nsCenterOrOffice objectAtIndex:z] isEqualToString:@"C"] is satisfied or not?
    • user2260521
      user2260521 almost 11 years
      yes..that condition is working. No issue in that statement.
    • Pratik
      Pratik almost 11 years
      then you can use image for pin
    • Admin
      Admin almost 11 years
      One issue with the updated code is MapAnnotation is a subclass of MKPointAnnotation and then re-declares coordinate as readonly. When the code later does dealAnnotation.coordinate, this assign is done to a different backing variable than the one that the getter for the new readonly coordinate will read. As a result, all annotations are probably going to 0,0. Generally, custom annotation classes should just be a subclass of NSObject and implement the MKAnnotation protocol (eg. MapAnnotation : NSObject<MKAnnotation>). And instead of declaring coordinate as readonly, use assign.
  • Rob
    Rob almost 11 years
    @user2260521 That revised viewForAnnotation looks more promising. There are a ton of issues here, of varying degrees of significance (the only obvious bug is initWithTitle doesn't call [super init], but then again, you don't use this method, so that's unlikely to be the source of your problem). If your problem is that the annotation is added right, but simply the wrong icon, you should log [nsCenterOrOffice objectAtIndex:z] in your viewForAnnotation. If your problem is something else, please clarify what the current problem is.