Forwarding DNS query from Linux to another two Windows DNS servers - dns

I have set up a linux server and configured the dns named service (LINDNS1). This will serve as the primary DNS for all internal clients. The only job it will do is to forward all the queries to the existing Windows DNS servers (WINDNS1 and WINDNS2).
So, when the client query goes to LINDNS1, it will forward the query to WINDNS1 if it can't find a record, it will forward the query to WINDNS2. If the record is in WINDNS2, it will answer the query.
I have set the forwarder settings on the dns configuration files. But it is not working.
named.conf #not much change here except for the standard settings.
listen-on port 53 { 127.0.0.1; LINDNS1 IP address; };
allow-query { localhost; any; }; #I just put 'any' for now while it's in a testing phase.
allow-query-cache { localhost; any; };
recursion yes;
The forwarding configuration is set in the named.rfcxxxx.zone file. I have included the reverse zones as well.
zone "test.net" IN {
type forward;
forwarders { 1.1.1.1; 2.2.2.2; };
};
Clients don't have any problem issuing nslookup, LINDNS1 can respond and can query records in WINDNS1 (1.1.1.1). But when querying a record that is in WINDNS2 (2.2.2.2), it returns that it can't find the host.

So, when the client query goes to LINDNS1, it will forward the query to WINDNS1 if it can't find a record, it will forward the query to WINDNS2. If the record is in WINDNS2, it will answer the query.
No. When LINDNS receives the answer NXDOMAIN from WINDNS1 it has no reason to ask other servers again about this record.
In your case WINDNS2 will be queried only if WINDNS fails (server is down, named is not running, etc)

Related

how to make an exchange of messages between two different computers in the same network?

How can have the simple exchange of message between two different computer
code of interface is:
interface MyInterface{
RequestResponse: Doppio(int)(int)
}
code of client is:
include "MyInterface.ol"
include "console.iol"
outputPort B {
Location: "socket://192.168.1.145:8000"
Protocol: http
Interfaces: MyInterface
}
main{
Doppio#B(5)(response);
print#Console(response)()
}
code of server is:
execution { concurrent }
include "MyInterface.ol"
inputPort B {
Location: "socket://192.168.1.145:8000"
Protocol: http
Interfaces: MyInterface
}
main {
Doppio(x)(Dop)
{
Dop=x*2
}
}
the code works because is the same PC and same IP address, but with 2 PC (with their IP address) doesn't work!
for me the problem is the socket but I don't know, help me please
In order to provide a temptative answer, I need to know, at least, two things:
basic network setup;
error message from the execution of the commands jolie server.ol and jolie client.ol.
Tip: pick an IP address of a different device connected to the same network, such as 192.168.1.xxx, and provide the result of ping 192.168.1.xxx. Also, the network/firewall should allow for incoming connections to the port you would choose (for instance 8000, as in the code snippet above).

Node.js dns.resolve not returning correct IP address

I'm trying to use Node.js DNS resolve to look up an IP address of a domain that belong to me (let's call it host.mydomain.com). If the lookup for host.mydomain.com is done from the server that host.mydomain.com actually points to, it returns the server's local NIC IP address (192.168.0.10) instead of the server's external IP address.
Doing a host lookup for host.mydomain.com from an external machine using the same code returns the expected external IP address. More importantly, I have a different server in another environment, call it host.otherdomain.com, that does correctly return its own external IP address when doing a lookup, using the same code.
I do not have anything in my hosts file that would override this. Both domains are from the same DNS provider, and both are wildcard domains.
My code:
var dns = require('dns');
dns.setServers([ "8.8.8.8", "8.8.4.4" ]);
domain="host.mydomain.com";
dns.resolve(domain, function (error, addresses) {
console.log("Error: ", error); // null
console.log("DNS servers: ", dns.getServers()); // [ '8.8.8.8', '8.8.4.4' ]
console.log(domain + " resolves to: ", addresses); // [ '192.168.0.10' ]
});
I'm currently using Node.js 6 on all servers.
In my case the problem turned out to be with the IBM datacenter where the machine was hosted. It was running on a modded vCenter setup their staff had set up, and was doing funky things with DNS. I know vCenter has Linux guest integration, I'm unsure if this was part of the problem.
So in short I guess the solution is to ensure your environment (in my case the datacenter) isn't messing you around.

Telnet Port connectivity from one server to another through JSP

Hi All,
I want to create a JSP page where I will ask user to give the source host and port and also destination host and port.
Following combination of source and destination OS is possible
Unix->Unix/Windows/zOS Windows-> Unix/Windows/zOS zOS ->
Unix/Windows/zOS
With these inputs I want to connect to the source server and fire this command telnet $ip $port to the destination. If the telnet connectivity is successful it should return success and else error.
I want to create the logic non-interactive that it should not require any password to login the source for checking telnet connectivity.
Is there any such library or any mechanism available so that I could make this feasible?
Why not use Apache Commons Net?
TelnetClient telnet = new TelnetClient();
try {
telnet.connect("rainmaker.wunderground.com", 3000);
} catch(IOException e) {
// failed
} finally {
telnet.disconnect();
}

Set preferred listen address in weblogic 11g

I have a WebLogic 11g domain with 1 admin server and 4 managed servers running on 2 machines. Each machine has 3 ip addresses, but only one of those addresses is seen by another machine. Each machine is running a node manager which seems to communicate fine between each other and admin server. Though when managed server starts on the second machine it can't communicate to admin server because it uses wrong ip address. It appears that when weblogic starts it maps itself to all ip addresses, but selects wrong one as the first one i.e. default. That's why managed servers recieve wrong information from node manager.
Is there a way to set preffered listen address in weblogic 11g, but still allow it to listen to all other addresses either? How does weblogic get list of ip addresses? Is the order of them OS-dependent?
Does this answer the question? I believe if you play with the scripts in /etc/sysconfig, you'll affect the loading order and thence the enumeration order. I must admit, I don't have a RH box here to confirm that suspicion.
Weblogic uses the NetworkInterface.getNetworkInterfaces() method and his own logic to set the order of the listen addresses. This logic is changed from 10.3.2 to 10.3.4.
The relevant code is in the method getAllAddresses of the class weblogic.server.channels.AddressUtils$AddressMaker in weblogic.jar
You can check the order with a simple test:
import java.net.*;
import weblogic.server.channels.*;
public class TestIP_WLS {
public static void main(String args[]) throws UnknownHostException {
System.out.println("=== AddressUtils.getIPAny()");
InetAddress addrs[] = AddressUtils.getIPAny();
for (InetAddress addr : addrs) {
System.out.println("*** " + addr);
}
}
}

How to Get WebSite IP that doesn't Answer Pings?

I'm trying to get the IP address of a website that does not respond to pings -- they time out.
I'm trying to do this from a C# application rather than the command entry screen in windows. I've been using the ping command which has times out on some sites so it is not useful there.
Is there another way to get this information that does not require the site to respond?
Even if the site does not respond to PINGs (ICMP not enabled on the server or filtered by firewall), the PING command should still resolve the site name into an IP address and display that IP address to you.
Check the output of a ping command on Windows (the ip address in bold):
ping wikipedia.org
Pinging wikipedia.org [208.80.152.2] with 32 bytes o
Reply from 208.80.152.2: bytes=32 time=245ms TTL=50
Reply from 208.80.152.2: bytes=32 time=235ms TTL=50
Update (due to to updated question)
If you are trying to get the IP address for DNS name from a C# application, you should use the GetHostEntry method from the Dns class: http://msdn.microsoft.com/en-us/library/ms143998.aspx .
You get IP from DNS, and need it to perform a ping, so you have it already.
$ ping google.com
PING google.com (74.125.227.51) 56(84) bytes of data.
64 bytes from 74.125.227.51: icmp_seq=0 ttl=56 time=5.80 ms
64 bytes from 74.125.227.51: icmp_seq=1 ttl=56 time=6.23 ms
The IP is shown. If you aren't getting an IP, your DNS might be down.
You can also try nslookup google.com
To get an IP address from a host name in Dns.GetHostEntry(). Pass in the host name and it will return you the IP address.
There is no reason you need to ping (on anyway contact) a site to get it's IP address. A DNS lookup will give you what you need.
You can use nslookup to resolve domain names.
nslookup google.com
The following code can be used to execute a DNS lookup for the supplied host name.
Using DNS will bypass accessing the target server. It is an independant distributed directory service that maintains hostname to IP address lookups.
The following code will give the first returned IP address for a host if a DNS entry can be resolved for the supplied host name.
public void test()
{
string hostname = "google.com";
IPAddress ipAdress;
if (TryGetIpAddress(hostname, out ipAdress))
{
Console.WriteLine("Host:'{0}', IP:{1}.", hostname, ipAdress);
}
else
{
Console.WriteLine("Host '{0}' not found.", hostname);
}
}
public bool TryGetIpAddress(string hostname, out IPAddress ipAddress)
{
const int HostNotFound = 11001;
ipAddress = null;
try
{
IPHostEntry hostEntry = Dns.GetHostEntry(hostname);
ipAddress = hostEntry.AddressList[0];
}
catch (SocketException ex)
{
if (ex.ErrorCode != HostNotFound) throw;
}
return (ipAddress != null);
}
You can use tracert and it will resolve the IP address and tell you if it can be reached or where it stops.
If site (http) is up and running then it is very well clear that the sys/network admin disabled ping and most probably trace route utility too. It is getting very common now. See here. Your alternative is to use ns lookup or WHOIS service as described here
Doing this in code you should have some function like gethostbyname().
This should be on stackoverflow.com
untested
You could host this website
http://centralops.net/co/DomainDossier.aspx
you could use import.io to make functinality with the site.
https://www.import.io/
this links could give you an insight

Resources