I think it’s a resolution issue more than permission. If you google the phrase “Name or service not known” (the error string you received) it’s all about different programs not being able to DNS resolve a hostname.
Did you try setting c.NotebookApp.ip = '0.0.0.0'
in your before.sh.erb
? I see several answers on stack overflow or their Github that say that’s the resolution.