Sponsored Content
Special Forums IP Networking TTL for IP addr from DNS through C code Post 302290373 by softindia on Monday 23rd of February 2009 05:16:10 AM
Old 02-23-2009
TTL for IP addr from DNS through C code

Hi All,
I know that getaddrinfo() return the multiple IP addresses (if present) for a hostname. But, I want to know how to get the TTL value for this list from DNS. I want to get this TTL value and cache this IP address list for that much time and then again go for DNS resolution if TTL expires.

Have any body come across such solution.Plz reply.

Thanks ...
 

9 More Discussions You Might Find Interesting

1. UNIX for Advanced & Expert Users

TTL field???

Hi all, I wonder, how I can change Time To Live field for icmp packet in Redhat 7.1, kernel 2.4.2-2? I looked up in /proc/sys/net/ipv4 and did find this field in there. There should be a way to change TTL. If it's in header file, in which one? Thank you all :p (11 Replies)
Discussion started by: solvman
11 Replies

2. UNIX for Dummies Questions & Answers

finger, getting name and pts from ip addr

im ultra new at unix and was wondering if its possible to create aliases of the write command that send messeges to users using an ip address. i was thinking to use the '|awk' with the command finger but as i've said im a total newbie. thanks a lot in advance. (2 Replies)
Discussion started by: swag:þ
2 Replies

3. AIX

AIX 5.3 , gensyms command, translate 32 bit addr to 64 bit addr

I am trying to map the information from the gensyms command, Its gives information about the various symbols info like symbol type, addr offset, and the main libraries addr starting point. My problem is , how do I map this 32 bit addr to a 64 bit addr, I am trying to extract Segment # information... (0 Replies)
Discussion started by: mrmeswani
0 Replies

4. UNIX for Dummies Questions & Answers

my_server.1.131.10.in-addr.arpa

Hi all, I am a newbie of setting up DNS server. Everything went fine except one thing. When I do "nslookup", my server name apears as "my_server.1.131.10.in-addr.arpa" rather than "my_server.my_domian.com" on my clients. Do you know how to fix it? Thanks. (2 Replies)
Discussion started by: stancwong
2 Replies

5. UNIX for Advanced & Expert Users

Internal heap ERROR 17113 addr=0x0

Hi, I'm running a COBOL process (with subroutines in standard C accessing an oracle database using OCI calls, using shared memories and sem etc....) on an AIX 5.1 machine. Under unusually heavy conditions (millions of loops in the process) I've got the following error: Execution error : file... (0 Replies)
Discussion started by: Isax50
0 Replies

6. Solaris

BAD TRAP: type=30 rp=2a10001b840 addr=2a000012040 mmu_fsr=0

Hello Gurus, I got a system reboot due to "unix: BAD TRAP: type=30 rp=2a10001b840 addr=2a000012040 mmu_fsr=0" on SUNW,Netra-CP2300. I guess it is caused by HW fault but not very sure, and don't know which part should be relaced incase it is HW reason really. Sincerely appreciate for your... (7 Replies)
Discussion started by: fangfang
7 Replies

7. Solaris

Set up TTL on process

Is there a way to setup the TTL (Time To Live) on a process. We have many ssh processes that seem to just stack up. These processes do not need a static connection all the time and it might cause problems on our servers. Does anybody know how to setup the TTL on a process? (10 Replies)
Discussion started by: jastanle84
10 Replies

8. Red Hat

DHCP & DNS - Clients get IP but don't register in DNS

I am trying to setup a CentOS 6.2 server that will be doing 3 things DHCP, DNS & Samba for a very small office (2 users). The idea being this will replace a very old Win2k server. The users are all windows based clients so only the server will be Linux based. I've installed CentOS 6.2 with... (4 Replies)
Discussion started by: FireBIade
4 Replies

9. Shell Programming and Scripting

ksh: How do I resolve ip addr in a text file?

Hi, I need to resolve IP to names in a text file. I was thinking of using some unix commands. Ksh. Text in file contains a lot of these entries: .. 20 6 <166>%ASA-6-302013: Built inbound TCP connection 12690562 for inside2:10.86.6.20/3678 (10.86.6.20/3678) to inside:10.107.22.12/1947... (3 Replies)
Discussion started by: hasselhaven
3 Replies
Net::DNS::ZoneFile(3)					User Contributed Perl Documentation				     Net::DNS::ZoneFile(3)

NAME
Net::DNS::ZoneFile - DNS zone file SYNOPSIS
use Net::DNS::ZoneFile; $zonefile = new Net::DNS::ZoneFile( 'named.example' ); while ( $rr = $zonefile->read ) { $rr->print; } @zone = $zonefile->read; DESCRIPTION
Each Net::DNS::ZoneFile object instance represents a zone file together with any subordinate files introduced by the $INCLUDE directive. Zone file syntax is defined by RFC1035. A program may have multiple zone file objects, each maintaining its own independent parser state information. The parser supports both the $TTL directive defined by RFC2308 and the BIND $GENERATE syntax extension. All RRs in a zone file must have the same class, which may be specified for the first RR encountered and is then propagated automatically to all subsequent records. METHODS
new $zonefile = new Net::DNS::ZoneFile( 'filename', ['example.com'] ); $handle = new FileHandle( 'filename', '<:encoding(ISO8859-7)' ); $zonefile = new Net::DNS::ZoneFile( $handle, ['example.com'] ); The new() constructor returns a Net::DNS::ZoneFile object which represents the zone file specified in the argument list. The specified file or file handle is open for reading and closed when exhausted or all references to the ZoneFile object cease to exist. The optional second argument specifies $ORIGIN for the zone file. Character encoding is specified indirectly by creating a FileHandle with the desired encoding layer, which is then passed as an argument to new(). The specified encoding is propagated to files introduced by $include directives. read $rr = $zonefile->read; @rr = $zonefile->read; When invoked in scalar context, read() returns a Net::DNS::RR object representing the next resource record encountered in the zone file, or undefined if end of data has been reached. When invoked in list context, read() returns the list of Net::DNS::RR objects in the order that they appear in the zone file. Comments and blank lines are silently disregarded. $INCLUDE, $ORIGIN, $TTL and $GENERATE directives are processed transparently. name $filename = $zonefile->name; Returns the name of the zone file from which RRs will be read. $INCLUDE directives will cause this to differ from the filename argument supplied when the object was created. line $line = $zonefile->line; Returns the number of the last line read from the current zone file. origin $origin = $zonefile->origin; Returns the fully qualified name of the current origin within the zone file. ttl $ttl = $zonefile->ttl; Returns the default TTL as specified by the $TTL directive. COMPATIBILITY WITH Net::DNS::ZoneFile 1.04 Applications which depended on the defunct Net::DNS::ZoneFile 1.04 CPAN distribution will continue to operate with minimal change using the compatibility interface described below. use Net::DNS::ZoneFile; $listref = Net::DNS::ZoneFile->read( $filename, $include_dir ); $listref = Net::DNS::ZoneFile->readfh( $handle, $include_dir ); $listref = Net::DNS::ZoneFile->parse( $string, $include_dir ); $listref = Net::DNS::ZoneFile->parse( $string, $include_dir ); $_->print for @$listref; The optional second argument specifies the default path for filenames. The current working directory is used by default. Although not available in the original implementation, the RR list can be obtained directly by calling any of these methods in list context. @rr = Net::DNS::ZoneFile->read( $filename, $include_dir ); read $listref = Net::DNS::ZoneFile->read( $filename, $include_dir ); @rr = Net::DNS::ZoneFile->read( $filename, $include_dir ); read() parses the specified zone file and returns a reference to the list of Net::DNS::RR objects representing the RRs in the file. The return value is undefined if the zone data can not be parsed. When called in list context, the partial result is returned if an error is encountered by the parser. readfh $listref = Net::DNS::ZoneFile->readfh( $handle, $include_dir ); readfh() parses data from the specified file handle and returns a reference to the list of Net::DNS::RR objects representing the RRs in the file. parse $listref = Net::DNS::ZoneFile->parse( $string, $include_dir ); $listref = Net::DNS::ZoneFile->parse( $string, $include_dir ); parse() interprets the zone file text in the argument string and returns a reference to the list of Net::DNS::RR objects representing the RRs. ACKNOWLEDGEMENTS
This package is designed as an improved and compatible replacement for Net::DNS::ZoneFile 1.04 which was created by Luis Munoz in 2002 as a separate CPAN module. The present implementation is the result of an agreement to merge our two different approaches into one package integrated into Net::DNS. The contribution of Luis Munoz is gratefully acknowledged. Thanks are also due to Willem Toorop for his constructive criticism of the initial version and invaluable assistance during testing. COPYRIGHT
Copyright (c)2011-2012 Dick Franks All rights reserved. This program is free software; you may redistribute it and/or modify it under the same terms as Perl itself. SEE ALSO
perl, Net::DNS, Net::DNS::RR, RFC1035 Section 5.1, RFC2308, BIND 9 Administrator Reference Manual perl v5.18.2 2014-01-16 Net::DNS::ZoneFile(3)
All times are GMT -4. The time now is 03:38 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy