EzDevInfo.com

reverse-dns interview questions

Top reverse-dns frequently asked interview questions

How do you resolve a domain name to an IP address with .NET/C#?

How do you resolve a domain name to an IP address with .NET/C#?


Source: (StackOverflow)

How to resolve DNS in Python?

I have a DNS script which allow users to resolve DNS names by typing website names on a Windows command prompt.

I have looked through several guides on the DNS resolve but my script can't still seem to resolve the names (www.google.com) or (google.com) to IP address.

The script outputs an error of

Traceback (most recent call last):
  File "C:\python\main_menu.py", line 37, in ?
    execfile('C:\python\showdns.py')
  File "C:\python\showdns.py", line 3, in ?
    x = input ("\nPlease enter a domain name that you wish to translate: ")
  File "<string>", line 0, in ?
NameError: name 'google' is not defined

The code:

import socket

x = input ("\nPlease enter a domain name that you wish to translate: ")

print ("\n\nThe IP Address of the Domain Name is: "+socket.gethostbyname_ex(x))

x = raw_input("\nSelect enter to proceed back to Main Menu\n")
if x == '1': 
execfile('C:\python\main_menu.py')

Please give advice on the codes. Thanks!


Source: (StackOverflow)

Advertisements

Reverse dns lookup with scapy in python

How can I do reverse DNS lookup using scapy in Python? I look for it in Google but I couldn't find related to this topic.


Source: (StackOverflow)

How to reverse IP to domain and get domains on the same server ?

I'm working on a small PHP website/script, and as one of the features I'd like to be able to run a Reverse IP Domain Check on the current domain the PHP script is running on. I don't know much about Reverse (well, I know what they do, I just don't know how to run them in PHP) Please let me know how to do it and get same result as : http://www.ipfingerprints.com/reverseip.php


Source: (StackOverflow)

Why is reverse DNS notation used for package naming?

There is a technical reason for using the reverse DNS package notation? Or is it just a convention?


Source: (StackOverflow)

Setting up reverse dns on windows azure? [closed]

Does anyone know if this is possible? Browsing around on the internet I found out that it had been put on the roadmap but that was quite a way back. Has anyone achieved this? It seems odd that such a big player in the hosting industry doesn't offer this, as AWS does.

Also, I'm talking about reverse dns on virtual machines not the ip addresses of cloud services. I assumed it was something to do on the configuration of the linux machine, since the virtual machines have root access I thought this may have been possible, although struggling to find info on it.


Source: (StackOverflow)

Android Browser hostnames does not get resolved if domain name is not appended [closed]

I am trying open a site hosted on my localhost using machine name in an android browser. When I type in machine name on a desktop browser , it gets resolved, but in an android device I get webpage not available. Server has been configured to handle DNS correctly and we do not see any errors.Please help.

Thank you


Source: (StackOverflow)

Why is ReverseDNS / getHostName() super slow for some addresses?

We have a problem in a sandboxed Java Applet because the SecurityManager does a reverse DNS lookup. See other question.

But the underlying problem is, that the Reverse DNS lookup takes about 4.5 seconds (without a domain result). The Problem is NOT the missing result (it returns the IP in that case), it's just the fact that it takes so long.

The problem is also independent of the SecurityManager, it only becomes a problem there because the Permissions class holds a lock while running into this and so freezes many other threads for 4.5 (or more) seconds.

There are also domains that don't have a domain-name result (ie. return the IP) which do not take 4.5 seconds. For example "staminus.net".

SSCCE:

String host = "random.org";
// "random.org" - IP result, takes 4.5 seconds
// "cdn.knuddelscom.de" - IP result, takes 4.5 seconds
// "staminus.net" - IP result, fast
// "google.com" - domain result: fra15s11-in-f14.1e100.net, fast
InetAddress addr = Inet4Address.getByName(host);
for (int i = 0; i < 100; i++)
{
    long start = System.currentTimeMillis();
    String hostName = Inet4Address.getByAddress(addr.getAddress()).getHostName();
    long end = System.currentTimeMillis();
    System.out.println((i + 1) + " RDNS " + host + " ... (" + (end - start) + "ms): " + hostName);
}

(Tested with Java JDK 1.8.0_40)

I used Sysinternals Process Explorer to make a windows API call thread dump of the hanging thread, but i don't know enough about it to tell what's happening:

ntoskrnl.exe!KeSynchronizeExecution+0x2246
ntoskrnl.exe!KeWaitForMultipleObjects+0x135e
ntoskrnl.exe!KeWaitForMultipleObjects+0xdd9
ntoskrnl.exe!KeWaitForSingleObject+0x373
ntoskrnl.exe!KeReleaseSemaphore+0xd33
ntoskrnl.exe!NtSetEvent+0xf99
ntoskrnl.exe!NtSetEvent+0x447
ntoskrnl.exe!RtlEqualUnicodeString+0x9ae
ntoskrnl.exe!setjmpex+0x34a3
ntdll.dll!ZwAlpcSendWaitReceivePort+0xa
RPCRT4.dll!NDRCContextBinding+0x6c8
RPCRT4.dll!NdrClientCall3+0xded
RPCRT4.dll!NdrClientCall3+0xfe
DNSAPI.dll!AddRefQueryBlobEx+0x753
DNSAPI.dll!DnsValidateName_W+0x1312
DNSAPI.dll!DnsQueryEx+0x103
mswsock.dll!Tcpip4_WSHOpenSocket2+0x1578
mswsock.dll!Tcpip4_WSHOpenSocket2+0x141e
mswsock.dll!Tcpip4_WSHOpenSocket2+0x1252
WS2_32.dll!WSALookupServiceNextW+0x1d8
WS2_32.dll!WSALookupServiceNextW+0xa3
WS2_32.dll!GetHostNameW+0x2e44
WS2_32.dll!GetHostNameW+0x1130
WS2_32.dll!getnameinfo+0xaf
net.dll!Java_java_net_Inet6AddressImpl_getHostByAddr+0x124

Since it is always about 4.5 seconds it looks very much like a timeout. Thus this explanation would be logical: The (R)DNS server does not answer our request.

How can we test this?

How can we fix this?


Source: (StackOverflow)

Best practice when using Reverse-DNS Package Notation and vanity domains?

When using reverse-DNS package notation (such as com.apple.ostype), what should one do when the domain name is designed to be read in its entirety (such as http://read.me)?

Strictly following the standard results in a package which, while syntactically correct, loses the desired overall identity—conversely, not following the standard retains identity but loses syntactical clarity (me.read.MyPackage versus read.me.MyPackage).

What is the common practice?


Source: (StackOverflow)

How long does a reverse DNS lookup take?

How long should I expect a reverse lookup take? 100 milliseconds? 1 second? 10 second? 30 seconds? What's your experience?

Why? We're debating adding a feature to our server software which would require a reverse DNS lookup each time a client connects. The lookup would be done synchronously, so I'm worried that it could slow connection-times down a lot. I just wanted to hear other people's experience regarding reverse DNS lookup times.


Source: (StackOverflow)

How to add RDNS if I have pointed multiple DNS to the server IP?

I have hosted 2 email servers in a single server. This server has only one public IP.

I have 2 domain names let say mail.aaa.com and mail.bbb.com which is pointed to this server, let say 1.2.3.4.

My internet service provider would not allow to add multiple RDNS for single IP. So that should I do for this problem?

Thank you!


Source: (StackOverflow)

Reverse DNS and SMTP

I'm in the middle of implementing Forward Confirmed Reverse DNS for my SMTP server. After reading around a bit, I found that it is best to do the lookup on the IP found at the other end of the SMTP connection (not in the mail header, because that IP is spoofed more easily). Once I have the hostname, I can compare it to the 'from' email domain in the header and determine if the email is valid.

However, I was thinking about it further and realized that this might not be the IP I want to do a lookup against. If the email message had to travel through several SMTP servers on the way to mine, wouldn't the IP on the other end of the SMTP connection reverse DNS back to the domain of the 'last hop' SMTP server, and not the domain of the 'from' email address?

And if the above is true, how do I know what IP is correct to do a lookup on?

Thanks, -Ben


Source: (StackOverflow)

spamassassin rdns reversedns

Spamassasin gives the following flag on my emails:

*

0.8 RDNS_NONE Delivered to internal network by a host with no rDNS

"This test checks to see if there is a reverse DNS entry for the last untrusted relay. Note that this may be done by interpreting information in the relevant Received header - if reverse DNS checks are not performed by the first trusted relay, or if they are not recorded in the Received header, this test will be triggered (regardless of the actual rDNS status)."

*

The only ip I can see on my emails are 94.143.11.2 -> which you can reverse dns to trophymanager.com. Google and hotmail have no problems with this - but Spamassassin gives it a flag - what am I missing here?


Source: (StackOverflow)

Beginners Mail Server - Reverse DNS and SPF records

My Question

Hello All! Man, I love Stack Overflow :)

Anyway, I am configuring my first ever Mail Server and want to do it right.

The actual server is configured and working great so just need a bit of help with the rdns & SFP public records of my domains. I have spent days researching but I am utterly confused so could do with a much appreciated hand.

Using this sample data below:

Domains the mail server handles: example.com, example.co.uk, example.net
Mail Server IP (For IMAP and SMTP): 123.123.123.123 for all domains
Website Server IP (A Record / For Port 80 HTTP): 101.101.101.101 = .com, 102.102.102.102 = .co.uk, 103.103.103.103 = .net

How do I setup the records?

My best guesses

rdsn set correct so emails not rejected as spam

Am I right in thinking that rdns is configured around the domains A records as follows:

rdns 101.101.101.101 = example.com
rdns 102.102.102.102 = example.co.uk
rdns 103.103.103.103 = example.net

And that the mail server on IP 123.123.123.123 can rdns to whatever my ISP decides? Or does the mail server IP rdsn have to point to one of the same IPs above (say 101.101.101.101 for the .com) in which case, whatabout the .co.uk and the .net? Is'nt RDNS set only one domain per IP? I've read a lot of conflicting information on all of this.

spf set correct so emails not rejected as spam

Do I set the below the same for each domain?

v=spf1 mx:example.com mx:example.co.uk mx:example.net  ~all

Or do I need a new domain which points straight to my mail server? Say:

mail.example.com (A Record / For Port 80 HTTP): 123.123.123.123

&

v=spf1 mx:mail.example.com  ~all

Set as the SPF for example.com, example.co.uk and example.net?

Any help on the above MUCH MUCH MUCH loved and appreciated. Thanks a lot. And ignore my best guesses if they are way off, only shown to display what I have learnt so far.

Also please note I have full control over rdsn, dns and MX records and spf txt etc on all my domains and IPs so whatever needs doing - i'll do it! Many thanks. :)


Source: (StackOverflow)

Reverse DNS lookup request IP in Rails

I have a Rails 3 site in which I've rolled my own user authentication.

I'm now in the process of integrating a 3rd party service (Fotomoto) that gets called with javascript on certain pages and needs to reach out from their serves to pull content from that page. How do I effectively whitelist requests from a certain domain *.fotomoto.com.

I would like to simply add some code to my before_filter that is smart enough to look at the requestor and determine whether it came from that domain. Fotomoto tells you how to allow their access at an Apache http level, but I only want to grant them access to certain controller actions.

def my_before_filter
  unauthorized_access unless signed_in? || request.remote_ip == ??? #check against *.fotomoto.com
end

And it seems like ideally I would be consulting a DNS server I trust. I'm hosting with Heroku if that matters.


Source: (StackOverflow)