Ubuntu: Redirecting dns ip to url locally



Question:

So I have this ip http://172.20.1.96:8080. I would like to redirect it to something like http://mywebsite.corp.com. I think I changed all the configurations that need to be changed, but I can only get into the website by typing 172.20.1.96:8080, but gets an error saying that its site can't be reached when typed in mywebsite.corp.com. I also mapped IP/hostname in the router.

P.S. I am trying to get it to work internally, no need to make it externally. I can also ping its ip from other server that is in same network, but not by its domain :(

I would really appreciated if someone could help! Thank you!

cat /etc/hosts  127.0.0.1       localhost.localdomain   localhost  172.20.1.96     mywebsite.corp.com  

hostname  mywebsite  

cat /etc/resolv.conf  # Dynamic resolv.conf(5) file for glibc resolver(3) generated by resolvconf(8)  #     DO NOT EDIT THIS FILE BY HAND -- YOUR CHANGES WILL BE OVERWRITTEN  nameserver 172.20.1.1  search localhost  search mywebsite.corp.com  


Solution:1

If from other server on that network, if is linux os command is host mywebsite.corp.com 172.20.1.1, I guess that is 172.20.1.1 your DNS server, you can not resolve logical name to ip address, problem is on record on dns server.

On DNS server you must have record, mywebsite.corp.com A 172.20.1.96.


Note:If u also have question or solution just comment us below or mail us on toontricks1994@gmail.com
Previous
Next Post »