Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to add an entry to chrome browser dns cache list (changing the source code)

I have been working on chrome source for a while and I am making some changes for performance test.

I am interested in adding new DNS entries to chrome cache, so that it shows up in chrome://net-internals/#dns

I have a hard time to find the right flow in the source code.

Can someone with experience please help?

I found the dns resolver code in /net/base/dnsrr_resolver.cc This is where the dns reolution occurs, however, I am interested in manually inserting dns entries without making a resolution call.

like image 362
saeideh Avatar asked Nov 03 '22 21:11

saeideh


1 Answers

I ended up modifying the code in net/base/host_resolve_proc.cc. This is where the system call for resolving happens. If the address list is updated with new resolution entries, the browser would update it's host cache with the new resolution.

like image 87
saeideh Avatar answered Nov 09 '22 10:11

saeideh