I've not tried fennel, but it should be OK so long as there aren't any plants from the same family flowering nearby.
Cut off head, pop in a paper bag, hang upside-down somewhere warm and dry (shed's good).
However, if it bolted easily, be aware it's offspring might be prone to the same
Hope that helps
D