DNS resolution issues when attempting to connect to login.microsoftonline.com

%3CLINGO-SUB%20id%3D%22lingo-sub-146379%22%20slang%3D%22en-US%22%3EDNS%20resolution%20issues%20when%20attempting%20to%20connect%20to%20login.microsoftonline.com%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-146379%22%20slang%3D%22en-US%22%3E%3CDIV%20class%3D%22body%22%3E%0A%3CDIV%3E%0A%3CP%3EI%20work%20for%20an%20ISP%20and%20starting%20recently%20our%20users%20have%20been%20experiencing%20issues%20when%20trying%20to%20reach%20certain%20Microsoft%20sub-domains.%20The%20most%20recent%20examples%20were%20passwordreset.microsoftonline.com%2C%20login.microsoftonline.com%20or%20portal.office.com.%3C%2FP%3E%0A%3CP%3EThe%20issues%20happen%20relatively%20regularly%20but%20inconsistently%2Fintermittently.%20We%20have%20narrowed%20it%20down%20to%20an%20issue%20at%20the%20home%20router%20levels.%3C%2FP%3E%0A%3CP%3EOur%20DNS%20servers%20have%20both%20UDP%20and%20TCP%20port%2053%20opened%20and%20all%20dns%20requests%20are%20returned%20properly.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EHowever%2C%20if%20the%20device%20uses%20it's%20DHCP%20assigned%20DNS%20values%2C%20which%20is%20the%20home%20router%20default%20gateway%20(usually%20a%20192.168.0.1%20type%20address)%20acting%20as%20a%20DNS%20forwarder%2C%20the%20DNS%20request%20times%20out.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EAfter%20running%20a%20few%20packet%20captures%20under%20a%20few%20different%20conditions%2C%20here%20is%20what%20I%20found%3A%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EIn%20all%20scenarios%20the%20DNS%20requests%20start%20with%20a%20UDP%20port%2053%20DNS%20lookup%20request%20which%20goes%20through%20fine%20and%20the%20computer%20receives%20a%20truncated%20answer%2C%20but%20instead%20of%20displaying%20the%20results%20of%20the%20truncated%20answer%2C%20a%20second%20DNS%20request%2C%20this%20time%20using%20TCP%20port%2053%20is%20sent.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EWhen%20polling%20the%20DNS%20server%20directly%20(DNS%20server%20settings%20set%20statically)%2C%20the%20DNS%20lookup%20results%20get%20displayed%20once%20the%20DNS%20server%20respond%20to%20the%20request%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EHowever%20when%20using%20the%20router%20as%20a%20forwader%2C%20using%20the%20default%2Fout%20of%20the%20box%20router%20DHCP-assigned%20DNS%20values%20(the%20router%20acts%20as%20both%20the%20DHCP%20server%20and%20assigns%20its%20own%20gateway%20address%20as%20the%20DNS%20server%20when%20offering%20a%20DHCP%20lease%20and%20DHCP%20configuration%20options)%2C%20the%20router%20seems%20to%20reject%20the%20TCP%20port%2053%20DNS%20lookup%20packets%20and%20responds%20with%20RST%20flagged%20packets%20without%20forwarding%20this%20TCP%20DNS%20request%2C%20leading%20to%20a%20timeout%20and%20the%20inability%20to%20load%20the%20pages%20in%20question.%3C%2FP%3E%0A%3CP%3EI%20understand%20that%20the%20UDP%20to%20TCP%20switch%20happens%20when%20a%20DNS%20record%20is%20larger%20than%20512%20Bytes%20and%20tat%20is%20the%20reason%20why%20the%20request%20is%20sent%20again%20that%20way%20but%20do%20not%20understand%20why%20the%20truncated%20answers%20are%20not%20used%20when%20the%20full%20answer%20cannot%20be%20obtained.%20The%20issue%20occurs%20on%20Windows%2C%20MacOSx%20%26amp%3B%20iOS%20using%20all%20sorts%20of%20browsers%20such%20as%20firefox%2C%20chrome%2C%20safari%2C%20ie%2C%20edge%2C%20etc...%20as%20well%20as%20when%20just%20attempting%20nslookups%20for%20those%20domains%20from%20the%20OS%20terminals.%3C%2FP%3E%0A%3CP%3EAlso%20tested%20on%20Android%20using%20the%20Termux%20app%2C%20and%20pointing%20nslookup%20to%20the%20gateway%20address.%20No%20issues%20with%20the%20browsers%20as%20it%20looks%20like%20android%20uses%20its%20own%20DNS%20settings%20and%20seems%20to%20ignores%20the%20DHCP%20provided%20DNS%20configuration%20(at%20least%20on%20the%20test%20device).%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EWhat%20can%20we%20do%20to%20ensure%20that%20our%20customers%20can%20access%20those%20pages%20without%20encountering%20this%20issue%20and%20without%20having%20to%20fully%20reconfigure%20their%20routers%20to%20provide%20custom%20DNS%20settings%2C%20which%20would%20be%20pretty%20backwards%20and%20would%20cause%20multiple%20issues%20whenever%20a%20router%20is%20reset%20to%20factory%20default%3F%3C%2FP%3E%0A%3C%2FDIV%3E%0A%3C%2FDIV%3E%3C%2FLINGO-BODY%3E%3CLINGO-LABS%20id%3D%22lingo-labs-146379%22%20slang%3D%22en-US%22%3E%3CLINGO-LABEL%3EOffice%20365%3C%2FLINGO-LABEL%3E%3C%2FLINGO-LABS%3E%3CLINGO-SUB%20id%3D%22lingo-sub-150987%22%20slang%3D%22en-US%22%3ERe%3A%20DNS%20resolution%20issues%20when%20attempting%20to%20connect%20to%20login.microsoftonline.com%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-150987%22%20slang%3D%22en-US%22%3E%3CP%3EJust%20as%20an%20FYI%20for%20anyone%20that%20may%20be%20looking%20into%20any%20similar%20issue%2C%20we%20have%20figured%20out%20exactly%20what%20is%20happening.%3C%2FP%3E%0A%3CP%3EAs%20suspected%2C%20the%20routers%20or%20Residential%20Gateways%20in%20question%20were%20not%20listening%20to%20TCP%20port%2053%20on%20their%20Default%20Gateway%20Address%2C%20which%20is%20as%20good%20as%20blocking%20it%20on%20their.%3C%2FP%3E%0A%3CP%3EIt%20appears%20that%20several%20brands%20have%20flawed%20firmware.%3C%2FP%3E%0A%3CP%3EThe%20only%20option%20is%20to%20either%20configure%20custom%20DNS%20settings%20to%20be%20served%20to%20the%20clients%20on%20the%20router%2C%20search%20for%20a%20firmware%20updated%20that%20fixes%20this%20issue.%20We%20opened%20a%20few%20tickets%20with%20some%20of%20our%20hardware%20vendors%20to%20have%20them%20investigate%20and%20fix%20the%20issue.%20One%20of%20those%20vendors%20is%20working%20on%20updating%20their%20firmware%20and%20will%20likely%20push%20a%20firmware%20upgrade%20globally%20in%20the%20months%20to%20come.%20Luckily%20their%20type%20of%20hardware%20allow%20for%20this%20upgrade%20to%20easily%20be%20pushed%20to%20all%20devices%20at%20once.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EIf%20you%20are%20experiencing%20this%20issue%2C%20look%20for%20firmware%20upgrades%2C%20if%20they%20exist%2C%20open%20a%20ticket%20with%20the%20vendor's%20customer%20service%20if%20you%20can%2C%20customize%20your%20router%20settings%20to%20serve%20a%20few%20custom%20DNS%20servers%2C%20or%20get%20a%20new%20router%20if%20all%20else%20fails.%3C%2FP%3E%3C%2FLINGO-BODY%3E
New Contributor

I work for an ISP and starting recently our users have been experiencing issues when trying to reach certain Microsoft sub-domains. The most recent examples were passwordreset.microsoftonline.com, login.microsoftonline.com or portal.office.com.

The issues happen relatively regularly but inconsistently/intermittently. We have narrowed it down to an issue at the home router levels.

Our DNS servers have both UDP and TCP port 53 opened and all dns requests are returned properly.

 

However, if the device uses it's DHCP assigned DNS values, which is the home router default gateway (usually a 192.168.0.1 type address) acting as a DNS forwarder, the DNS request times out.

 

After running a few packet captures under a few different conditions, here is what I found:

 

In all scenarios the DNS requests start with a UDP port 53 DNS lookup request which goes through fine and the computer receives a truncated answer, but instead of displaying the results of the truncated answer, a second DNS request, this time using TCP port 53 is sent.

 

When polling the DNS server directly (DNS server settings set statically), the DNS lookup results get displayed once the DNS server respond to the request

 

However when using the router as a forwader, using the default/out of the box router DHCP-assigned DNS values (the router acts as both the DHCP server and assigns its own gateway address as the DNS server when offering a DHCP lease and DHCP configuration options), the router seems to reject the TCP port 53 DNS lookup packets and responds with RST flagged packets without forwarding this TCP DNS request, leading to a timeout and the inability to load the pages in question.

I understand that the UDP to TCP switch happens when a DNS record is larger than 512 Bytes and tat is the reason why the request is sent again that way but do not understand why the truncated answers are not used when the full answer cannot be obtained. The issue occurs on Windows, MacOSx & iOS using all sorts of browsers such as firefox, chrome, safari, ie, edge, etc... as well as when just attempting nslookups for those domains from the OS terminals.

Also tested on Android using the Termux app, and pointing nslookup to the gateway address. No issues with the browsers as it looks like android uses its own DNS settings and seems to ignores the DHCP provided DNS configuration (at least on the test device).

 

What can we do to ensure that our customers can access those pages without encountering this issue and without having to fully reconfigure their routers to provide custom DNS settings, which would be pretty backwards and would cause multiple issues whenever a router is reset to factory default?

1 Reply

Just as an FYI for anyone that may be looking into any similar issue, we have figured out exactly what is happening.

As suspected, the routers or Residential Gateways in question were not listening to TCP port 53 on their Default Gateway Address, which is as good as blocking it on their.

It appears that several brands have flawed firmware.

The only option is to either configure custom DNS settings to be served to the clients on the router, search for a firmware updated that fixes this issue. We opened a few tickets with some of our hardware vendors to have them investigate and fix the issue. One of those vendors is working on updating their firmware and will likely push a firmware upgrade globally in the months to come. Luckily their type of hardware allow for this upgrade to easily be pushed to all devices at once.

 

If you are experiencing this issue, look for firmware upgrades, if they exist, open a ticket with the vendor's customer service if you can, customize your router settings to serve a few custom DNS servers, or get a new router if all else fails.