The roof surface must be completely clean prior to caulking or else the caulking won't bond as strongly to the roof and the duct. Wash the area of the roof around the duct and the duct itself in warm water and several drops of dish soap. Scrub any dirt with a scrub brush to ensure it comes off but avoid soaking the roof to avoid leaks. Allow the surface to dry thoroughly before continuing. Scrape out any old caulking between the duct and the roof with a scraper or razor. Insert the tip of a caulk gun into the seam and press the trigger of the caulk gun. Move the tip slowly around the seam as the caulk comes out to apply a smooth, steady caulk stream.
There are various types of caulking, so make sure the caulk you use is intended for the roofing surface you're applying it to. Caulks are designed specifically for concrete, glass, wood or ceramic. Polyurethane caulk works for most outdoor uses because it sticks to most materials, doesn't shrink much over time and remains partially elastic so it responds well to expansion and contraction caused by temperature changes. Acrylic caulk is another option to consider because many types contain a fungicide that prevents mold from growing on it.
No matter what type of caulk you use, it needs to be checked regularly because it eventually will wear down. Inspect the seal between the roof and the duct on a monthly basis to ensure the caulk maintains a tight seal. This especially is true after a storm or harsh weather event. Gently rinse any dirt or debris off of the caulk with a damp rag to keep the caulking clean. If you notice the caulk starting to peel, crack or break, reclean the surface, chip out the old caulk with a razor and apply a fresh coat of it for best results and maximum protection.
Caulk isn't the only option when sealing a roof duct. Tapes and mastics are other alternatives. Mastic is a thick, gooey material that fits into the seam between the duct and the roof. Fiberglass mesh tape often is inserted into the seam first for added support, and the duct itself is secured to the roof with No. 8 sheet metal screws before the mastic is added with a putty knife. In spite of its name, duct tape actually is not effective at sealing ducts, so its use should be avoided. Oriented polypropylene tape is effective when used with flex ducts. It has a film backing, which is more durable than the cloth backing of many duct tapes, and a long-lasting acrylic adhesive.