IP address to Domain Name? DNS? - dns

I'm trying to find the authoritative name servers for a given IP address and as far as I can see the only way to find the name servers is by using the domain name of the IP.
How do I convert the IP to domain name (not hostname)?
Or how do I find the authoritative name servers for any IP address?

You can use dig to get PTR RR, for example:
dig -x 8.8.8.8

Related

How browser find IP address from domain name?

As we enter url in browser. browser check IP address in host file for domain name. And If IP address is not find in there than how browser find IP address from internet for particular domain name?
DNS is what you're looking for.

different IPs for same dns nameserver

This is my configuration: I have 2 DNS servers with of course 2 different IPs and both of them have the nameserver ns1.example.com.
Now,I have to point a new domain to the new server but I have problems with it, if I dig +trace the domain it returns the old IP for ns1.xxx.com which is also existing.
Is it possible to have the following?
ns1.example.com 192.168.1.1
ns1.example.com 192.168.2.1
It is possible. Whether it is suitable for your setup is impossible to tell with the above information.
Does DNS1 have the IP address 192.168.1.1 and 192.168.2.1, is the subnet mask 255.255.0.0? Then yes, this is absolutely fine.
If DNS2's IP is 192.168.2.1 than no, I would change the configuration.

How forward and reverse DNS works

What I understand about how DNS works is like this: first let's assume mydomain.com has the IP address 12.34.56.78. Now when I put the url mydomain.com in the browser, the browser sends a dns lookup to its local dns server, asking, hey, do you know the ip address for mydomain.com. If the local dns server does not know about it, it will ask the parent dns servers, if the parent also does not know, then it keeps asking all the way up until the root dns server. The root dns server will ask some server in charge of the .com tld. The dns server in charge of the .com will have knowledge about mydomain.com because mydomain.com is the .com family. Then the answer will be returned back to the initial asker. Also the answer quite likely will be cached in the dns servers involved in the asking process. Would anyone correct my understanding if it is wrong.
So my real question is about how reverse dns lookup works. Let's say if I want to find out what domain name is for the ip 12.34.56.78. I run the command dig -x 12.34.56.78. If my local dns server does not know the answer, which server does it further ask? Is it 12.in-addr.arpa., or 34.12.in-addr.arpa.? If this is the case, are these names like 12.in-addr.arpa. valid domain names? And where should they be deployed so that the reverse lookup requests will know whom to ask?
How a reverse DNS lookup is accomplished:
The DNS resolver reverses the IP, and adds it to ".in-addr.arpa" (or ".ip6.arpa" for IPv6 lookups), turning 192.0.2.25 into 25.2.0.192.in-addr.arpa.
The DNS resolver then looks up the PTR record for 25.2.0.192.in-addr.arpa.
The DNS resolver asks the root servers for the PTR record for 25.2.0.192.in-addr.arpa.
The root servers refer the DNS resolver to the DNS servers in charge of the Class A range (192.in-addr.arpa, which covers all IPs that begin with 192).
In almost all cases, the root servers will refer the DNS resolver to a "RIR" ("Regional Internet Registry"). These are the organizations that allocate IPs. In general, ARIN handles North American IPs, APNIC handles Asian-Pacific IPs, and RIPE handles European IPs.
The DNS resolver will ask the ARIN DNS servers for the PTR record for 25.2.0.192.in-addr.arpa.
The ARIN DNS servers will refer the DNS resolver to the DNS servers of the organization that was originally given the IP range. These are usually the DNS servers of your ISP, or their bandwidth provider.
The DNS resolver will ask the ISP's DNS servers for the PTR record for 25.2.0.192.in-addr.arpa.
The ISP's DNS servers will refer the DNS resolver to the organization's DNS servers.
The DNS resolver will ask the organization's DNS servers for the PTR record for 25.2.0.192.in-addr.arpa.
The organization's DNS servers will respond with "host.example.com".
Source here.

DNS setting to access website using IP address and domain name

I have Static IP, i would like to access website using static IP as well using domain name.
I have below DNS entries to for my domain, i am not sure what setup i need to do to make it works.
when user access my site using domain name they should be able to access. Also when someone want to access using IP address they should be able to do that.
www 14400 IN CNAME example.com
example.com 14400 IN A 50.63.147.111
If anybody have idea please let me know.
Thank you
Regards,
Mona
If you can't access your IP address, then it isn't because of your DNS. DNS stands for domain name system and translates domain names TO IP addresses. Thus, you must already have a reachable IP address for your A record to be meaningful. Make sure that you've configured your server correctly (Apache?) and that the necessary ports are open in your firewall (iptables).
Check that your domain registrar is pointing its name servers to the authoritative name server (the server with your zone file) for your domain.

Ping Command and Domains

I always thought a domain was a collection of machines related in some way. When I ping a domain name, like google.com, how come just one IP address is returned? What is this IP referring to?
To quote centos.org BIND documentation:
Zone File Resource Records
...
A — Address record, which specifies an IP address to assign to a name.
<host> IN A <IP-address>
Figure 14-7. Sample A record configuration
If the <host> value is omitted, then an A record points to a default IP address for the top of the namespace. This system will be the target of all non-FQDN requests.
Consider the following A record examples for the domain.com zone file:
IN A 10.0.1.3
server1 IN A 10.0.1.5
In the above, 10.0.1.3 is the IP of the domain. E.g. if the above was the zone file for domain example.com, ping example.com would ping 10.0.1.3. Each domain has this "default" IP address and, as is the case with server1 above, other IPs.
As a side note, you can have multiple IPs pointed by the same DNS name - this is used for load balancing (see e.g. this or this). To see this, doo nslookup google.com.
A domain name is simply a human-friendly pointer to an IP address.
The IP address is referring to the address of the machine that particular domain name points to. This is determined by using DNS.
Some larger domains, like google.com, do indeed have many IP addresses associated with them, for redundancy reasons. Because these additional IP addresses are assumed to return the same content, most programs, including ping, just return an arbitrary one. If you wanted to see all these IP address, you can use the dig program.

Resources