Thread: [GD-Windows] DNS server temporary change
Brought to you by:
vexxed72
From: Diogo de A. <Dio...@ne...> - 2004-04-06 10:10:40
|
Hey all! I have an application running on a computer with some DNS settings... The problem is, sometimes I need to resolve an name to an IP address, and I can only do that through another DNS server... My question is, is it possible to do so in C++? Or will I have to use the command line "nslookup" and parse the result? Or the only way is to implement a complete DNS client? Thanks in advance Diogo de Andrade dio...@sp... |
From: Dr A. P. <aj...@eu...> - 2004-04-06 11:36:16
|
I don't know how easy it is to do this from c++ - however one of the best things I have learned over the last few years is that not everything needs to be "elegant". If nslookup works - I sugest you just use it. It may feel dirty, but you will get more work done with this attitude! I have wasted a lot of time in the past trying to make things "perfect", when often a simple solution will do just as well. It is important to remark that the code must still be easily maintainable however. Regards, Andrew > -----Original Message----- > From: gam...@li... > [mailto:gam...@li...]On Behalf Of > Diogo de Andrade > Sent: 06 April 2004 11:11 > To: gam...@li... > Subject: [GD-Windows] DNS server temporary change > > > Hey all! > > I have an application running on a computer with some DNS settings... > The problem is, sometimes I need to resolve an name to an IP address, > and I can only do that through another DNS server... My question is, is > it possible to do so in C++? Or will I have to use the command line > "nslookup" and parse the result? Or the only way is to implement a > complete DNS client? > > Thanks in advance > > Diogo de Andrade > dio...@sp... > > > > > > > ------------------------------------------------------- > This SF.Net email is sponsored by: IBM Linux Tutorials > Free Linux tutorial presented by Daniel Robbins, President and CEO of > GenToo technologies. Learn everything from fundamentals to system > administration.http://ads.osdn.com/?ad_id=1470&alloc_id=3638&op=click > _______________________________________________ > Gamedevlists-windows mailing list > Gam...@li... > https://lists.sourceforge.net/lists/listinfo/gamedevlists-windows > Archives: > http://sourceforge.net/mailarchive/forum.php?forum_id=555 > > _____________________________________________________________________ > This e-mail is confidential and may be privileged. It may be > read, copied and used only by the intended recipient. No > communication sent by e-mail to or from Eutechnyx is intended to > give rise to contractual or other legal liability, apart from > liability which cannot be excluded under English law. > > This message has been checked for all known viruses by Star > Internet delivered through the MessageLabs Virus Control Centre. > > www.eutechnyx.com Eutechnyx Limited. Registered in England No: 2172322 _____________________________________________________________________ This e-mail is confidential and may be privileged. It may be read, copied and used only by the intended recipient. No communication sent by e-mail to or from Eutechnyx is intended to give rise to contractual or other legal liability, apart from liability which cannot be excluded under English law. This message has been checked for all known viruses by Star Internet delivered through the MessageLabs Virus Control Centre. www.eutechnyx.com Eutechnyx Limited. Registered in England No: 2172322 |
From: Diogo de A. <Dio...@ne...> - 2004-04-06 12:05:05
|
I agree with that attitude (and have done so in the past)... Getting the job done is the most important thing... how you get there is (more often than not) not important... I was just wondering, since nslookup comes with Windows, if the source code is available, or if it just uses something in the platform SDK that might come in handy in this case... if I can't find it, I will use it (although it sucks having to code some way to get stuff out of standard output - redirect the stream from my code, maybe?) Thanks! Diogo de Andrade dio...@sp... -----Original Message----- From: gam...@li... [mailto:gam...@li...] On Behalf Of Dr Andrew Perella Sent: ter=E7a-feira, 6 de Abril de 2004 12:36 To: gam...@li... Subject: RE: [GD-Windows] DNS server temporary change I don't know how easy it is to do this from c++ - however one of the best things I have learned over the last few years is that not everything needs to be "elegant". If nslookup works - I sugest you just use it. It may feel dirty, but you will get more work done with this attitude! I have wasted a lot of time in the past trying to make things "perfect", when often a simple solution will do just as well. It is important to remark that the code must still be easily maintainable however. Regards, Andrew > -----Original Message----- > From: gam...@li... > [mailto:gam...@li...]On Behalf Of > Diogo de Andrade > Sent: 06 April 2004 11:11 > To: gam...@li... > Subject: [GD-Windows] DNS server temporary change > > > Hey all! > > I have an application running on a computer with some DNS settings... > The problem is, sometimes I need to resolve an name to an IP address, > and I can only do that through another DNS server... My question is, is > it possible to do so in C++? Or will I have to use the command line > "nslookup" and parse the result? Or the only way is to implement a > complete DNS client? > > Thanks in advance > > Diogo de Andrade > dio...@sp... > > > > > > > ------------------------------------------------------- > This SF.Net email is sponsored by: IBM Linux Tutorials > Free Linux tutorial presented by Daniel Robbins, President and CEO of > GenToo technologies. Learn everything from fundamentals to system > = administration.http://ads.osdn.com/?ad_id=3D1470&alloc_id=3D3638&op=3Dcli= ck > _______________________________________________ > Gamedevlists-windows mailing list > Gam...@li... > https://lists.sourceforge.net/lists/listinfo/gamedevlists-windows > Archives: > http://sourceforge.net/mailarchive/forum.php?forum_id=3D555 > > _____________________________________________________________________ > This e-mail is confidential and may be privileged. It may be > read, copied and used only by the intended recipient. No > communication sent by e-mail to or from Eutechnyx is intended to > give rise to contractual or other legal liability, apart from > liability which cannot be excluded under English law. > > This message has been checked for all known viruses by Star > Internet delivered through the MessageLabs Virus Control Centre. > > www.eutechnyx.com Eutechnyx Limited. Registered in England No: 2172322 _____________________________________________________________________ This e-mail is confidential and may be privileged. It may be read, copied and used only by the intended recipient. No communication sent by e-mail to or from Eutechnyx is intended to give rise to contractual or other legal liability, apart from liability which cannot be excluded under English law.=20 This message has been checked for all known viruses by Star Internet delivered through the MessageLabs Virus Control Centre.=20 www.eutechnyx.com Eutechnyx Limited. Registered in England No: 2172322 ------------------------------------------------------- This SF.Net email is sponsored by: IBM Linux Tutorials Free Linux tutorial presented by Daniel Robbins, President and CEO of GenToo technologies. Learn everything from fundamentals to system administration.http://ads.osdn.com/?ad_id=3D1470&alloc_id=3D3638&op=3Dcli= ck _______________________________________________ Gamedevlists-windows mailing list Gam...@li... https://lists.sourceforge.net/lists/listinfo/gamedevlists-windows Archives: http://sourceforge.net/mailarchive/forum.php?forum_id=3D555 |
From: Chris R. <c....@gm...> - 2004-04-07 13:19:25
|
I would use getaddrinfo() to fill a addrinfo structure or use gethostname() to fill a hostent structure. If the name you specified exists both structures will contain the IP-Address in network byte-order which can be converted to an ascii string by the use of the inet_ntoa() function.=20 All these functions are well documented in the Platform SDK -> Windows Sockets.=20 Of course, you have to link against the WinSock Library and IIRC you have to initialize the library as well.=20 hoping to have helped,=20 chris=20 On Tue, 2004-04-06 at 12:10, Diogo de Andrade wrote: > Hey all! >=20 > I have an application running on a computer with some DNS settings... > The problem is, sometimes I need to resolve an name to an IP address, > and I can only do that through another DNS server... My question is, is > it possible to do so in C++? Or will I have to use the command line > "nslookup" and parse the result? Or the only way is to implement a > complete DNS client? >=20 > Thanks in advance >=20 > Diogo de Andrade > dio...@sp... >=20 >=20 >=20 >=20 >=20 >=20 > ------------------------------------------------------- > This SF.Net email is sponsored by: IBM Linux Tutorials > Free Linux tutorial presented by Daniel Robbins, President and CEO of > GenToo technologies. Learn everything from fundamentals to system > administration.http://ads.osdn.com/?ad_id=3D1470&alloc_id=3D3638&op=3Dcli= ck > _______________________________________________ > Gamedevlists-windows mailing list > Gam...@li... > https://lists.sourceforge.net/lists/listinfo/gamedevlists-windows > Archives: > http://sourceforge.net/mailarchive/forum.php?forum_id=3D555 >=20 |
From: Jon W. <hp...@mi...> - 2004-04-07 16:53:01
|
It sounds like the original requester has a specific DNS set-up on the local machine that prevents the plain functions from working, but at times he wants to actually get a real DNS resolution from the outside world. nslookup allows you to specify a specific, non-local host for looking up names, hence it would work even if local DNS is differently configured. I'm not going to speculate about what this could be useful for, except to say that we use DNS as a well-tested, high-performance distributed name space database in our server cluster. We wrote our own DNS client code, which isn't that hard -- and it supports asynchronous operation ;-) Cheers, / h+ -----Original Message----- From: gam...@li... [mailto:gam...@li...]On Behalf Of Chris Raine Sent: Wednesday, April 07, 2004 6:20 AM To: gam...@li... Subject: Re: [GD-Windows] DNS server temporary change I would use getaddrinfo() to fill a addrinfo structure or use gethostname() to fill a hostent structure. If the name you specified exists both structures will contain the IP-Address in network byte-order which can be converted to an ascii string by the use of the inet_ntoa() function. All these functions are well documented in the Platform SDK -> Windows Sockets. Of course, you have to link against the WinSock Library and IIRC you have to initialize the library as well. hoping to have helped, chris On Tue, 2004-04-06 at 12:10, Diogo de Andrade wrote: > Hey all! > > I have an application running on a computer with some DNS settings... > The problem is, sometimes I need to resolve an name to an IP address, > and I can only do that through another DNS server... My question is, is > it possible to do so in C++? Or will I have to use the command line > "nslookup" and parse the result? Or the only way is to implement a > complete DNS client? > > Thanks in advance > > Diogo de Andrade > dio...@sp... > > > > > > > ------------------------------------------------------- > This SF.Net email is sponsored by: IBM Linux Tutorials > Free Linux tutorial presented by Daniel Robbins, President and CEO of > GenToo technologies. Learn everything from fundamentals to system > administration.http://ads.osdn.com/?ad_id=1470&alloc_id=3638&op=click > _______________________________________________ > Gamedevlists-windows mailing list > Gam...@li... > https://lists.sourceforge.net/lists/listinfo/gamedevlists-windows > Archives: > http://sourceforge.net/mailarchive/forum.php?forum_id=555 > |
From: Diogo de A. <Dio...@ne...> - 2004-04-07 23:42:43
|
Yes, that's what I wanted... I can't have a custom solution, since my software needs to integrate with existing software... and badly done at that, too... :| One of the things I'm considering is to use a database and an app that runs nslookup for the cases necessary (filling the database) and using that database to avoid complexity on the server side of things... but it's sloppy coding... The other alternative is to do an implementation of a DNS client (shouldn't be too hard, really... I heard the protocol is pretty simple and it works in a straightforward manner) Diogo de Andrade dio...@sp... -----Original Message----- From: gam...@li... [mailto:gam...@li...] On Behalf Of Jon Watte Sent: quarta-feira, 7 de Abril de 2004 17:53 To: gam...@li... Subject: RE: [GD-Windows] DNS server temporary change It sounds like the original requester has a specific DNS set-up on the local machine that prevents the plain functions from working, but at times he wants to actually get a real DNS resolution from the outside world. nslookup allows you to specify a specific, non-local host for looking up names, hence it would work even if local DNS is differently configured. I'm not going to speculate about what this could be useful for, except to say that we use DNS as a well-tested, high-performance distributed name space database in our server cluster. We wrote our own DNS client code, which isn't that hard -- and it supports asynchronous operation ;-) Cheers, / h+ -----Original Message----- From: gam...@li... [mailto:gam...@li...]On Behalf Of Chris Raine Sent: Wednesday, April 07, 2004 6:20 AM To: gam...@li... Subject: Re: [GD-Windows] DNS server temporary change I would use getaddrinfo() to fill a addrinfo structure or use gethostname() to fill a hostent structure. If the name you specified exists both structures will contain the IP-Address in network byte-order which can be converted to an ascii string by the use of the inet_ntoa() function. All these functions are well documented in the Platform SDK -> Windows Sockets. Of course, you have to link against the WinSock Library and IIRC you have to initialize the library as well. hoping to have helped, chris On Tue, 2004-04-06 at 12:10, Diogo de Andrade wrote: > Hey all! > > I have an application running on a computer with some DNS settings... > The problem is, sometimes I need to resolve an name to an IP address, > and I can only do that through another DNS server... My question is, is > it possible to do so in C++? Or will I have to use the command line > "nslookup" and parse the result? Or the only way is to implement a > complete DNS client? > > Thanks in advance > > Diogo de Andrade > dio...@sp... > > > > > > > ------------------------------------------------------- > This SF.Net email is sponsored by: IBM Linux Tutorials > Free Linux tutorial presented by Daniel Robbins, President and CEO of > GenToo technologies. Learn everything from fundamentals to system > administration.http://ads.osdn.com/?ad_id=1470&alloc_id=3638&op=click > _______________________________________________ > Gamedevlists-windows mailing list > Gam...@li... > https://lists.sourceforge.net/lists/listinfo/gamedevlists-windows > Archives: > http://sourceforge.net/mailarchive/forum.php?forum_id=555 > ------------------------------------------------------- This SF.Net email is sponsored by: IBM Linux Tutorials Free Linux tutorial presented by Daniel Robbins, President and CEO of GenToo technologies. Learn everything from fundamentals to system administration.http://ads.osdn.com/?ad_id=1470&alloc_id=3638&op=click _______________________________________________ Gamedevlists-windows mailing list Gam...@li... https://lists.sourceforge.net/lists/listinfo/gamedevlists-windows Archives: http://sourceforge.net/mailarchive/forum.php?forum_id=555 |