c# - PrincipalContext.ValidateCredentials slow with trusted domain using NetBios name -


i've created service validates credentials against active directory using system.directoryservices.accountmanagement. need validate credentials against local domain trusted domain. response time validating credentials fast both local , trusted domain when run on computer. when move service our server, local domain response fast however, trusted domain response slow (20 - 30 seconds).

i've found if change domain name in principalcontext netbios name dns name corrects the performance problem on server.

here's examples

principalcontext context = new principalcontext(contexttype.domain, snetbiosname) context.validatecredentials(susername, spassword) 

on server, above take 20-30 seconds using netbios name

principalcontext context = new principalcontext(contexttype.domain, sdnsname) context.validatecredentials(susername, spassword) 

using dns name response 0-2 seconds

any ideas on needs setup on server speed using netbios name?

netbios notoriously slow in big network. here explains how netbios name resolution works. normally, windows tris resolve netbios name in following order.

  1. local cache
  2. lmhosts file
  3. wins server
  4. network broadcast

so, can see 1 thing can improve netbios name resolution speed edit lmhosts file on server, can take network out of equation. follow microsoft kb add domain , pdc lmhosts file.


Comments

Popular posts from this blog

apache - Add omitted ? to URLs -

redirect - bbPress Forum - rewrite to wwww.mysite prohibits login -

php - How can I stop spam on my custom forum/blog? -