This is a bug. I think I never tested a dirinstall with -N, I've always used -c. I did some changes in setting/reading the hostname in FAI 5.1 and 5.1.2, so this may be the cause of your problems.
Can you please file a bug report for this? I'm on vacation, so not much time to look deeper into it now. -- regards Thomas