This paper addresses the problem of beamforming (BF) design for orthogonal frequency division multiplexing (OFDM) based relay networks over frequency-selective channels. Both frequencydomain (FD) BF and time-domain (TD) BF are investigated. The later requires less feedback from the destination to perform BF. The BF vectors are designed by maximizing the minimum signal-tonoise-ratio (SNR) over all subcarriers at the destination, first under the total power constraint (TPC) and then under the per-relay power constraint (PPC). We show that both TPC and PPC BF designs lead to a quasi-convex optimization problem, which can be solved by bisection search method efficiently. Simulation results demonstrate that based on max-min SNR criterion, the performance of TD-BF rapidly approaches that of FD-BF when increasing the filter length. Moreover, it is found that for TD-BF, the minimum filter length required to achieve optimum performance under PPC is longer than that under TPC.