SRX

last person joined: yesterday 

Ask questions and share experiences about the SRX Series, vSRX, and cSRX.
  • 1.  Static DNS on a SRX

    Posted 06-18-2015 07:55

     

    Hello,

     

    On our SSG's we have the options under Network > DNS > Cache and this will allow the entry of a static DNS entry.

     

    I cannot however see the same option on the SRX? is the same functionality still available ?

     

    Many Thanks,



  • 2.  RE: Static DNS on a SRX

     
    Posted 06-18-2015 08:00
    Yes you can still do that!

    See the below url!!! (Scroll a bit down the first part is in Dutch ) examples are in English

    http://www.redelijkheid.com/blog/2013/2/20/juniper-srx-with-dns-proxy-service-enabled


  • 3.  RE: Static DNS on a SRX
    Best Answer

    Posted 06-19-2015 01:24

    two ways.

    https://kb.juniper.net/InfoCenter/index?page=content&id=KB26800&smlogin=true

     

    Summary:

    This article provides information on how to add static DNS mappings in SRX.

     

    Problem or Goal:

    The requirement is to add static DNS mappings; for example, if you want www.abc.com, no DNS requests should be sent to a DNS server and it should automatically be resolved to an IP address (for example, 1.1.1.1).

     

    Cause:

     

     

    Solution:

    There are a couple ways to achieve this:

    Add host to /etc/hosts fileTo add the static DNS mappings, modify the /etc/hosts file on the SRX device as follows:
    1. Go to the shell:
      root@SRX> start shell
    2. Edit  the /etc/hosts file via the VI editor:
      root@SRX% vi /etc/hosts
    3. Press i to enter the insert mode and add the following entry:
      1.1.1.1 www.abc.com
    4. Type : wq to save the file.
    Then, when you try to ping www.abc.com, SRX will automatically ping 1.1.1.1:

     

    root@SWITCH# run ping www.abc.com
    PING www.abc.com (1.1.1.1): 56 data bytes



    Use static-host-mapping

    Another method is to add an alias to an IP address using the static-host-mapping option:

    root# set system static-host-mapping DPT inet 1.1.1.1
    root# set system static-host-mapping DPT alias abc.com
    root# commit

    You can also add host-name to an IP address:

    root# set sysyem static-host-mapping www.abc.com inet 1.1.1.1
    root# commit

    root# run ping abc.com
    PING abc.com (1.1.1.1): 56 data bytes
    64 bytes from 1.1.1.1: icmp_seq=0 ttl=57 time=31.675 ms
    64 bytes from 1.1.1.1: icmp_seq=1 ttl=57 time=31.133 ms
    64 bytes from 1.1.1.1: icmp_seq=2 ttl=57 time=31.152 ms
    ^C
    --- abc.com ping statistics ---
    3 packets transmitted, 3 packets received, 0% packet loss
    round-trip min/avg/max/stddev = 31.133/31.320/31.675/0.251 ms

    For more information, refer to the Related Links below.