In Named Data Networking (NDN) content consumers request data by names instead of sending requests to specific destination addresses. This fits shared media particularly well for benefits such as native multicast, mobility support, and fault tolerance. However, since current network interface cards only filter packets based on destination addresses, all NDN packets have to be delivered to software for name-based filtering, resulting in significant CPU overhead. We propose NDN-NIC, a network interface card that filters packets based on their content names, to minimize the CPU overhead while running NDN over shared media. This paper tackles NDN-NIC's main research challenge: using the limited amount of on-chip memory (in tens of kilobytes) to support packet filtering based on a large number of rulesets (in hundreds of thousands). We use Bloom filters to store various name tables on NDN-NIC, and design a number of mechanisms to further adjust the name prefixes that go into the Bloom filters, minimizing false positives under given memory limit. Using traffic traces collected from a department network, simulations show that NDN-NIC with 16KB of memory can filter out 96.30% of all received packets and reduce the main CPU usage by 95.92%.