Community discussions

MikroTik App
 
User avatar
arbabnazar
Frequent Visitor
Frequent Visitor
Topic Author
Posts: 70
Joined: Tue May 03, 2011 1:37 pm

how to access/ping the host on LAN by hostname instead of ip

Sun Jan 29, 2012 8:37 pm

Here is my simple network scenario, in which mikrotik is everything(firewall,dhcp,dns etc).

Image

I am able to ping/access the hosts on LAN by their ip but i can't be able to access them or ping them by using hostname.
can somebody tell me how i can accomplish this task please?

thanks
 
tjc
Member Candidate
Member Candidate
Posts: 276
Joined: Sun Jul 10, 2011 3:08 am

Re: how to access/ping the host on LAN by hostname instead o

Mon Jan 30, 2012 2:47 am

First you need to make sure the machines on your LAN use your router as their primary DNS.

Then, for anything with a static address:
/ip dns static add address=192.168.1.10 name=server1
For machines that get their address via DHCP you would need to write a script that scans through your DHCP leases and maps client-id to assigned address. Someone posted an example of this not to long ago so a search should turn it up pretty quickly.
 
User avatar
arbabnazar
Frequent Visitor
Frequent Visitor
Topic Author
Posts: 70
Joined: Tue May 03, 2011 1:37 pm

Re: how to access/ping the host on LAN by hostname instead o

Mon Jan 30, 2012 1:55 pm

I already did this but it didn't make any difference. i still can't be able to access the host by its hostname but still can access by ip.

any idea?

thanks
 
tjc
Member Candidate
Member Candidate
Posts: 276
Joined: Sun Jul 10, 2011 3:08 am

Re: how to access/ping the host on LAN by hostname instead o

Tue Jan 31, 2012 7:24 am

Do the names show up if you list the static DNS entries and the cached entries?
/ip dns static print
/ip dns cache print
If you use nslookup and specify the name server as your router does it resolve the names?
nslookup YOUR_HOSTNAME_HERE YOUR_ROUTER_IP_HERE
 
User avatar
arbabnazar
Frequent Visitor
Frequent Visitor
Topic Author
Posts: 70
Joined: Tue May 03, 2011 1:37 pm

Re: how to access/ping the host on LAN by hostname instead o

Tue Jan 31, 2012 9:21 am

Here is the result of all the commands that you mentioned:

Note: (srv is a ubuntu 10.04 LTS server)

Image

Image

Image

Image

Also Wireshark capture, may be it will give some hint!

Image

thanks in advance
 
User avatar
arbabnazar
Frequent Visitor
Frequent Visitor
Topic Author
Posts: 70
Joined: Tue May 03, 2011 1:37 pm

Re: how to access/ping the host on LAN by hostname instead o

Tue Jan 31, 2012 6:19 pm

I am able to solve this problem and here is what i did.

*I simply install the samba on ubuntu server using (sudo apt-get install samba smbfs), by doing this, i am able to ping ubuntu server from my windows host.

* To ping my windows host from ubuntu server, i simply install winbind by using (sudo apt-get install winbind) and after that i am able to ping all of my windows clients from ubuntu server.

I hope this will help the other, who faced the same/similar problem.

thanks
 
User avatar
nest
Forum Veteran
Forum Veteran
Posts: 823
Joined: Tue Feb 27, 2007 1:52 am
Location: UK
Contact:

Re: how to access/ping the host on LAN by hostname instead o

Wed Feb 01, 2012 1:11 am

I believe if you use a single name such as "srv" it will look for the IP via NETBIOS and will fail. If your server has a fully qualified domain name, such as srv.local and then were to add srv.local in the Mikrotik DNS server, I think you will have better luck as it will then use DNS correctly?
 
User avatar
arbabnazar
Frequent Visitor
Frequent Visitor
Topic Author
Posts: 70
Joined: Tue May 03, 2011 1:37 pm

Re: how to access/ping the host on LAN by hostname instead o

Wed Feb 01, 2012 8:34 am

we can integrate the Mikrotik router with Windows 2k8 Active Directory?
 
User avatar
nest
Forum Veteran
Forum Veteran
Posts: 823
Joined: Tue Feb 27, 2007 1:52 am
Location: UK
Contact:

Re: how to access/ping the host on LAN by hostname instead o

Wed Feb 08, 2012 3:25 am

we can integrate the Mikrotik router with Windows 2k8 Active Directory?
what do you mean 'integrate'? It can't replace the DNS server within 2k8, no.
 
User avatar
arbabnazar
Frequent Visitor
Frequent Visitor
Topic Author
Posts: 70
Joined: Tue May 03, 2011 1:37 pm

Re: how to access/ping the host on LAN by hostname instead o

Wed Feb 08, 2012 8:45 am

we can integrate the Mikrotik router with Windows 2k8 Active Directory?
what do you mean 'integrate'? It can't replace the DNS server within 2k8, no.
Like, I want that my mikrotik act as dhcp server and Win2K8 R2 act as DNS with the role of DC and my mikrotik automatically update DNS record on it (a.ka. A record).
 
User avatar
nest
Forum Veteran
Forum Veteran
Posts: 823
Joined: Tue Feb 27, 2007 1:52 am
Location: UK
Contact:

Re: how to access/ping the host on LAN by hostname instead o

Thu Feb 09, 2012 12:05 am

I believe that without some scripting, Dynamic DNS updates from the DHCP server is not possible