How can I let anonymous users comment only once?
You can do this by means of two functions called flood_register_event() and 
 flood_is_allowed().

When a anon user views a node, call flood_is_allowed in hook_node_view that sets COMMENT_NODE_CLOSED for the node.

When a anon user comments, register that as a flood event in hook_comment_presave for that particular node. By setting the $threshold (parameter for flood_is_allowed) to 1, the user will be stopped from commenting after the first comment is posted.

This is the bare bones of how to implement hooks that make use of these functions:

function MYMODULE_comment_presave($comment) {
  global $user;
  if (!$user-&gt;uid) {
    flood_register_event($comment-&gt;nid);
  }
}
function MYMODULE_node_view($node, $view_mode, $langcode) {
  global $user;
  if (!$user-&gt;uid &amp;&amp; !flood_is_allowed($node-&gt;nid, 1)) {
    // This bars the anon user from posting a second comment of the node.
    // For a more sophisticated blocking method (e.g. to prevent the comment form from
    // showing up), ask another question about how to do that.
    $node-&gt;comment = COMMENT_NODE_CLOSED;
  }
}


PS: The module Anonymous Publishing is already using this pair of functions to limit the number of comments an anonymous user can post (but not exactly in the way you specify).  However, looking at the source code of that module should give you an idea about how to use this pair of functions for flood control of anonymous comments.