We describe a new method for modeling protein and ligand main-chain flexibility, and show its ability to model flexible molecular recognition. The goal is to sample the full conformational space, including large-scale motions that typically cannot be reached in molecular dynamics simulations due to the computational intensity, as well as conformations that have not been observed yet by crystallography or NMR. A secondary goal is to assess the degree of flexibility consistent with protein–ligand recognition. Flexibility analysis of the target protein is performed using the graph-theoretic algorithm FIRST, which also identifies coupled networks of covalent and noncovalent bonds within the protein. The available conformations of the flexible regions are then explored with ROCK by random-walk sampling of the rotatable bonds. ROCK explores correlated motions by only sampling dihedral angles that preserve the coupled bond networks in the protein and generates conformers with good stereochemistry, without using a computationally expensive potential function. A representative set of the conformational ensemble generated this way can be used as targets for docking with SLIDE, which handles the flexibility of protein and ligand side-chains. The realism of this protein main-chain conformational sampling is assessed by comparison with time-resolved NMR studies of cyclophilin A motions. ROCK is also effective for modeling the flexibility of large cyclic and polycyclic ligands, as demonstrated for cyclosporin and zearalenol. The use of this combined approach to perform docking with main-chain flexibility is illustrated for the cyclophilin A–cyclosporin complex and the estrogen receptor in complex with zearalenol, while addressing the question of how much flexibility is allowed without hindering molecular recognition. Proteins 2004. © 2004 Wiley-Liss, Inc.