473,698 Members | 2,411 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

need to reduce DNS queries in a python application

1 New Member
recently I found that a high amount of DNS queries related to my database which was hosted at AWS are sent from my python application. I have fixed it in my separate Java project by overriding java.security file and by changing the networkaddress. cache.ttl parameter to 1hr. I need to apply the same thing to my python application. I am using the requests library. can anyone suggest a way to implement this? Thanks
Nov 2 '21 #1
1 14267
dreamtext
24 Recognized Expert New Member
have you looked at
https://dnspython.readthedocs.io/en/...r-caching.html

Seems you would have to initiate a cache and put records into it and flush the keys at the time frame you need
The dnspython resolver does not cache by default, but caching can be enabled by creating a cache and assigning it to the resolver’s cache attribute. If a cache has been configured, the resolver caches both positive and negative responses.
Nov 20 '21 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

1
1687
by: TDC | last post by:
Hi all, The Python Application framework made it's first release. This framework will make your life as a application developper a lot easier. PAF consists of a set of easy-to-use components, such as CORBA-support, error-handling and a GUI framework based on wxPython. You can check it out for yourself at our open source site www.dctools.org .
2
2336
by: Miki Tebeka | last post by:
Hello All, I have a funny problem: An embedded python application is working fine on a "clean" computer. When it runs on a computer with python installed (the very same computer used to produce the application) it has a import error: ---------- can't import SACD module (sacd.py) Error in sys.exitfunc:
52
5873
by: Dick Moores | last post by:
I need to figure out how to compute pi to base 12, to as many digits as possible. I found this reference, <http://mathworld.wolfram.com/Base.html>, but I really don't understand it well enough. Could someone show me how to do what I need? Thanks, Dick Moores rdm@rcblue.com
3
1258
by: Ajay | last post by:
hi All, I am writing a java application which queries DB2. I need SQL queries for following : 1. Query to check whether, the attributes for LOB columns like BLOB and CLOB is "LOGGED" or not? 2. Query for checking if tables are created under table space of pagesize 32K or not?
35
2869
by: Michel Sanner | last post by:
Hello, One of the greatest feature of Python in my opinion is the way the interpreter can be used to integrate a wide variety of software packages by dynamically linking them. This approach has been extremely successful for us so far but now I run into a license nightmare. Some the libraries we wrapped using SWIG are under GPL but the applications we are distributing are not (mainly because
0
916
by: loial | last post by:
I have been asked to install a python application on AIX 5.3 that runs OK on Windows I have installed Python 4.2.2 from python.org and pyXML form sourceforge. However when I run the application I get the following error : class xml.sax._exceptions.SAXReaderNotAvailable Do I need to set some Python environment variables?
5
1414
by: dongarbage | last post by:
Hi, Is there a way to create a .dll from a python program which includes the python runtime? I'm building a Windows application (C# VisualStudio2005) and I'd like to utilize some of the functionality available in a Python module. For my users who install my Windows application, I'd prefer that they not have to install the entirety of Python on their machines.
3
1307
by: helzer | last post by:
I need to add spell checking to my Python application (for Windows). Any ideas on where to start? Thanks, Helzer
4
1146
by: ron.longo | last post by:
I haven't figured out a way to do this but see no reason why it cannot be done. I have a decent size application written in 100% Python. I would like to distribute this application, but only the .pyc files. Since the ..pyc's are just the compiled sources I figured it would work, but if I copy just the pyc's and my main app's py into a directory by themselves, I'm unable to execute. Why is this? At this point I'm not really keen on...
13
3555
by: susanne | last post by:
Hi, I am very new to the python web applications. can some one help. I have a python application with some functions in it. 1) The application reads an input file ( say, IN.txt). the IN.txt file contains names of three other files( x.dat, y.txt, z.dat) that are in the same directory. 2) then the application reads the data in the files x.dat, y.txt, z.dat and performs some calculations. 3) outputs the results in a file...
0
8675
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9160
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
8897
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8862
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
7729
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6521
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
4619
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
2331
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2002
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.