In a medium saucepan, combine vinegar, dill seed, mustard seed, peppercorns, garlic, red pepper flakes, lemon zest, and bay leaves over low heat. Cook for 10 minutes; do not boil. Remove from heat, and set aside to cool.
In a large Dutch oven, combine water, crab boil, and 2 teaspoons salt over medium-high heat. Bring to a boil. Add shrimp; cook for 2 to 3 minutes, just until pink and firm. Drain shrimp, and set aside to cool. In a medium bowl, whisk together olive oil, vinegar mixture, and remaining 2 teaspoons salt. In a large resealable plastic bag, combine shrimp, lemons, onion, and marinade. Seal bag, and refrigerate for 8 to 12 hours, turning occasionally. Let come to room temperature before serving. If desired, squeeze the cut lemons from the bag over the shrimp.